rsync

Rsync is an open-source tool that is used for synchronizing and transferring files between two locations. It is widely used by system administrators and developers for efficient and reliable file transfer.

Usage

To use rsync:

rsync [options] source destination

Either source or destination can be a local folder or a remote path (user@host:path)

Options

optiondescription
—quiet, -qsuppress non-error messages
—archive, -aarchive mode
—recursive, -rrecurse into directories
—update, -uskip files that are newer on the receiver
—appendappend data onto shorter files
—verbose, -vincrease verbosity
—links, -lcopy symlinks as symlinks
—perms, -ppreserve permissions
—chmod=CHMODaffect file and/or directory permissions
—owner, -opreserve owner (super-user only)
—group, -gpreserve group
—dry-run, -nperform a trial run with no changes made
—one-file-system, -xdon’t cross filesystem boundaries
—rsh=COMMAND, -especify the remote shell to use
—deletedelete extraneous files from dest dirs
—remove-source-filessender removes synchronized files (non-dir)
—compress, -zcompress file data during the transfer
—exclude=PATTERNexclude files matching PATTERN
—exclude-from=FILEread exclude patterns from FILE
—statsgive some file-transfer stats
—progressshow progress during transfer
—human-readable, -houtput numbers in a human-readable format
—log-file=FILElog what we’re doing to the specified FILE
—partialkeep partially transferred files
-Psame as —partial —progress