Last Updated: February 25, 2016
·
948
· dpashkevich

Common rsync commandline

I find myself calling rsync with the following parameters quite often to synchronize my working directory with a server:

rsync -az --no-o --no-g --progress . user@host:/target/path

Explanation:

  • Synchronizes current directory with /target/path on the remote host
  • -a "archive mode" (recurse into directories, copy symlinks as symlinks, preserve permissions, preserve modification times, transfer special files, preserve group and owner of files;equals to a whole pack of options -rlptgoD)
  • --no-o and --no-g remove the o and g options that preserve owner and group of files (you probably have different users and groups on different machines)
  • --progress output some progress information on each file being transferred (this option also implies --verbose)
  • -z compress files during transfer (you may want to omit this if you transmit lots of binary files)