Saturday, January 17, 2015

Backups with rsync

Summary

rsync is a nifty command for doing backups.  I'm not going to even attempt go through all the options available with it.  I'm just going to show the one that works for me for doing backups of my NAS.

Implementation

$ rsync -ah --progress --delete --exclude ".Trash*" /source/ /target
  • -a : 'archive mode.' Sets a conglomeration of options that you can review on the man page if you're interested
  • -h : human-readable output
  • --progress : feedback on the progress of the backup
  • --delete : deletes any files on the target that don't exist on the source
  • --exclude : excludes any files from backup with the given pattern.  Ubuntu systems create a .Trash directory that doesn't need to be backed up
  • trailing slashes on source and target matter