Last active
June 5, 2017 10:59
-
-
Save keithmorris/5c8167a5774ff80e868d to your computer and use it in GitHub Desktop.
OSX Rsync Backup to External Drive
This file contains hidden or 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/bash | |
src=/Users/kmorris | |
backupPath=/Volumes/Backups/backups | |
date=`date "+%Y-%m-%dT%H%M%S"` | |
dirname=backup_$date | |
excludeFile=/Users/kmorris/bin/backup-excludes.txt | |
rsync -aAXPlv --exclude-from=$excludeFile --link-dest=$backupPath/latest $src $backupPath/$dirname | |
rm -f $backupPath/latest | |
ln -s $backupPath/$dirname $backupPath/latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment