$linuxjunkies
>

stsync(1)

Synchronize files and directories between local and remote systems using the Secure Technology Stack protocol.

UbuntuDebianFedoraArch

Synopsis

stsync [OPTION]... SOURCE DESTINATION

Description

stsync is a secure file synchronization utility that transfers files and directory structures between local and remote systems. It provides encrypted transport, bandwidth throttling, and intelligent change detection to efficiently synchronize only modified content.

The command supports one-way and two-way synchronization modes, with options for deletion, compression, and atomic transfers. Remote paths use SSH-style syntax: user@host:path.

Common options

FlagWhat it does
-r, --recursiverecursively synchronize directories and subdirectories
-a, --archivearchive mode; preserves permissions, timestamps, and symbolic links
-v, --verboseincrease verbosity; show transferred files and progress
--deletedelete files on destination that no longer exist on source
-z, --compresscompress file data during transfer to save bandwidth
-e, --exclude=PATTERNexclude files matching PATTERN from synchronization
--bwlimit=KBPSlimit bandwidth usage to specified kilobytes per second
--checksumskip files based on checksum rather than modification time
-n, --dry-runshow what would be transferred without actually copying files
--timeout=SECONDSset connection timeout for remote transfers
--atomicwrite to temporary file and move atomically on completion
-p, --progressshow progress bar for each file transfer

Examples

recursively synchronize local documents directory to remote backup location with verbose output

stsync -r -v /home/user/documents [email protected]:/backup/docs

archive mode sync with deletion and compression; useful for keeping local mirror in sync

stsync -a --delete -z source/ dest/

synchronize project directory excluding temporary and git files to remote server

stsync -r --exclude='*.tmp' --exclude='.git' /project user@server:/backups/project

dry-run of syncing large data with 1MB/s bandwidth limit to show what would transfer

stsync -r -n --bwlimit=1024 /large/data backup@nas:/mnt/storage

synchronize based on file checksums with atomic writes for data integrity

stsync --checksum --atomic /source /destination

pull backup from remote server to current directory with 30-second timeout

stsync -r -v --timeout=30 user@remote:/home/user/backup .

archive-mode sync of web directory to remote server with progress and deletion of old files

stsync -a -p --delete /var/www user@webserver:/var/www

Related commands