Skip to content

Instantly share code, notes, and snippets.

@dphiffer
Created December 12, 2017 18:29
Show Gist options
  • Save dphiffer/deaae4cf98e40072f26a1710ea5053c8 to your computer and use it in GitHub Desktop.
Save dphiffer/deaae4cf98e40072f26a1710ea5053c8 to your computer and use it in GitHub Desktop.
rsync backup
**/Library/Developer
**/Library/Logs
**/Library/Caches
**/Library/Mail
**/Library/com.apple.nsurlsessiond
**/Library/Accounts
**/Library/Address?Book?Plug-Ins
**/Library/Assistant
**/Library/Calendars
**/.cache
**/.vagrant.d/boxes
**/.vagrant.d/cache
**/.Trash
**/tmp
*.nobackup
*.tmp
**/.heroku
**/.npm
**/.DS_Store
**/.localized
Adobe/
PHP Manual/
tiles.seoul/
vpn/
**/node_modules
CheckIn/
Ghost-0.11.3/
**/.git
**/.scrapy
tiles.zip
tiles/
tiles.seoul/
tiles.tw/
cordova-test/
explore/
#!/bin/sh
echo "Documents"
date
rsync -r -v --ignore-existing --exclude-from=backup-exclude.txt \
"/Volumes/Macintosh HD 1/Users/dphiffer/Documents/" \
/Volumes/dphiffer/dphiffer-work/dphiffer/Documents/
echo "Desktop"
date
rsync -r -v --ignore-existing --exclude-from=backup-exclude.txt \
"/Volumes/Macintosh HD 1/Users/dphiffer/Desktop/" \
/Volumes/dphiffer/dphiffer-work/dphiffer/Desktop/
echo "dot-ssh"
date
rsync -r -v --ignore-existing --exclude-from=backup-exclude.txt \
"/Volumes/Macintosh HD 1/Users/dphiffer/.ssh/" \
/Volumes/dphiffer/dphiffer-work/dphiffer/dot-ssh/
echo "Sites"
date
rsync -r -v --ignore-existing --exclude-from=backup-exclude.txt \
"/Volumes/Macintosh HD 1/Users/dphiffer/Sites/" \
/Volumes/dphiffer/dphiffer-work/dphiffer/Sites/
echo "All done"
date
@dphiffer
Copy link
Author

  1. modify the backup.sh to include --dry-run with each call to rsync
  2. pipe the output: ./backup.sh > backup.txt
  3. check backup.txt, make adjustments to backup-excludes.txt in case you don't want certain folders
  4. remove the --dry-run and run it again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment