rsync

Exemples de commandes

rsync -ghoprutvz --progress SRC DEST
-g : preserve group
-h : output numbers in a human-readable format
-o : preserve owner
-p : preserve permissions
-r : recursive
-u : skip files that are newer on the receiver
-t : preserve modification times
-v : verbose
-z : compress file data during the transfer
--progress : show progress during transfer
rsync -alSvh SRC DEST
-a : archive mode; equals -rlptgoD (no -H,-A,-X)
-l : copy symlinks as symlinks
-S : handle sparse files efficiently
-v : verbose
-h : output numbers in a human-readable format

SSH

rsync -e ssh -avz SERVER:/PATH DEST
-e : specify the remote shell to use
-a : archive mode; equals -rlptgoD (no -H,-A,-X)
-v : verbose
-z : compress file data during the transfer

Port non standard

rsync -e 'ssh -p PORT' -avz SERVER:/PATH DEST

Commutateurs utiles

-a, --archive        archive mode; equals -rlptgoD (no -H,-A,-X)
-n, --dry-run        perform a trial run with no changes made
-z, --compress       compress file data during the transfer
-E, --executability  preserve executability
-L, --copy-links     transform symlink into referent file/dir
-X, --xattrs         preserve extended attributes
--delete             delete extraneous files from dest dirs
--exclude=PATTERN    exclude files matching PATTERN
--exclude-from=FILE  read exclude patterns from FILE
--log-file=FILE      log what we're doing to the specified FILE
--numeric-ids        don't map uid/gid values by user/group name
--stats              give some file-transfer stats