Skip to content

Instantly share code, notes, and snippets.

@drodriguez
Created May 30, 2012 13:43
Show Gist options
  • Save drodriguez/2836414 to your computer and use it in GitHub Desktop.
Save drodriguez/2836414 to your computer and use it in GitHub Desktop.
Rsync backup
# This document specifies exceptions to the backup
# To specify an EXCLUSION, put "- " (a minus and a space) before the entry
# To specify an INCLUSION, put "+ " (a plus and a space) before the entry
# Rules are applied IN ORDER
#
# These rules allow backing up of the iTunes Music Library files,
# but not the other contents of ~/Music or ~/Music/iTunes/
+ iTunes/
+ .localized
- iTunes Music/
- /Music/*
#
# These rules prevent backing up of certain caches and the trash
- Cache/
- /Library/Caches/
- /.Trash/
- /.Trashes/
#
rsync -avE --exclude-from exceptions.txt "$HOME"/ "$DESTINATION" --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment