Created
November 2, 2011 01:02
-
-
Save artifactsauce/1332529 to your computer and use it in GitHub Desktop.
Backup script for Mac OS X home directory by rsync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CMDNAME=`basename $0` | |
while getopts n OPT | |
do | |
case $OPT in | |
"n" ) DRY_RUN="--dry-run" ;; | |
* ) echo "Usage: $CMDNAME [-n]" 1>&2 | |
exit 1 ;; | |
esac | |
done | |
SOURCE=${HOME}/ | |
TARGET=/Volumes/BACKUP/TARGET | |
[[ ! -d $TARGET ]] && echo "Target directory does NOT exists." && exit 1 | |
rsync -av --stats --delete-excluded --modify-window=1 $DRY_RUN \ | |
--include "/.ssh/" \ | |
--include "/.dotfiles/" \ | |
--include "/Library/Keychains/*" \ | |
--include "/Library/Application?Support/Adium?2.0/" \ | |
--include "/Library/Application?Support/Cyberduck/" \ | |
--include "/Library/Application?Support/GitHub?for?Mac/" \ | |
--include "/Library/Application?Support/KeyRemap4MacBook/" \ | |
--include "/Library/Application?Support/Postbox/" \ | |
--include "/Library/Application?Support/Sequel?Pro/" \ | |
--include "/Library/Application?Support/Skype/" \ | |
--exclude "/.*" \ | |
--exclude "/perl5/" \ | |
--exclude "/Dropbox/" \ | |
--exclude "/Pictures/" \ | |
--exclude "/Movies/" \ | |
--exclude "/Music/" \ | |
--exclude "/Library/*/*" \ | |
--exclude ".DS_Store" \ | |
--exclude ".localized" \ | |
${SOURCE} ${TARGET} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just found this and it is beautiful, thanks for uploading.