Created
November 26, 2011 19:37
-
-
Save ptitov/1396194 to your computer and use it in GitHub Desktop.
MacOS user data rsync backup script with openssl encryption
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
NUMSECTORS=600000 #300mb | |
URL=rsync://HOSTNAME/DIRECTORY/ | |
EXCLUDE=Evernote | |
BACKUP="\"Library/Application Support\" Documents" | |
PASSWORD= | |
# create ramdisk | |
RAMDISK=`hdid -nomount ram://$NUMSECTORS` | |
newfs_hfs $RAMDISK | |
RDPATH=/tmp/ramdisk.backup | |
mkdir $RDPATH | |
mount -t hfs $RAMDISK $RDPATH | |
cd | |
tar cjf $RDPATH/backup.tar.bz2 --exclude $EXCLUDE $BACKUP | |
PASS=$PASSWORD openssl des3 -salt -pass env:PASS -in $RDPATH/backup.tar.bz2 -out $RDPATH/backup.tar.bz2.enc | |
rsync --progress $RDPATH/backup.tar.bz2.enc $URL | |
umount $RAMDISK | |
hdiutil detach $RAMDISK | |
rmdir $RDPATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment