Monday, January 14, 2008

rsync arguments

rsync -a src/ dst/ is too aggresive when backing up files between different file systems - most notably between Samba & Unix. -a is a short hand for -rlptgoD
  • -r recursive
  • -l copy symlinks as symlinks
  • -p preserve permissions
  • -t preserve times
  • -g preserve group
  • -o preserve owner (super-user only)
  • -D same as --devices --specials
None of these options, except for -r, are useful when copying to or from Samba. So invoke rsync this way instead: rsync -Cr --exclude=.DS_Store --size-only src/ dst/
  • -C auto-ignore files in the same way CVS does
  • -r recursive
  • --exclude=.DS_Store don't copy Macintosh directory info
  • --size-only skip files that match in size