rsync commands


rsync arguments while reviewing rsync with con jobs crontab


  • -a Archive mode - does recursion, symbolic links, retaining group permissions (use with care), etc
  • -v Verbose mode for the log file/standard out
  • -r Recursively go through the subdirectories
  • -l Recreate symbolic links.
  • -p Set remote file permissions as local file permissions (use with care)
  • -t Set remote file permissions as local file times (highly useful)
  • -q Quiet mode (useful for cron jobs such as this)
  • --stats More verboseness for the log gile
  • -e ssh Specify Secure Shell (SSH) protocol (if this is installed). Though if you leave this out it defaults to the UNIX rsh
  • -z Use compression during file transfer
  • --delete Delete files that are no longer present (delete first, then update) (default is not to and there is a backup option as well)
  • --delete-after Delete old file after downloading the update
  • --exclude= Exclude areas you don't want to have mirrored (or deleted because they don't exist on the server)
    • Regular expressions can be used.
2015-01-24 22:24:50gstlouis


2015-01-24 22:25:43

argument definitions

2016-04-01 19:00:08

In order to keep two directories truly in sync, it is necessary to delete files from the destination directory if they are removed from the source. By default, rsync does not delete anything from the destination directory.

We can change this behavior with the --delete option. Before using this option, use the --dry-run option and do testing to prevent data loss:

rsync -a --delete source destination

2015-07-08 22:14:42

2015-07-08 22:14:55