Backups
Having lost all my data before (Years ago, before becoming a techie) and having worked for a Data Storage Company, I have been a bit paranoid about backing my stuff up. Luckily I have plenty of storage on the home NAS (xray).
Mac OS X is lacking for a decent backup solution. I tried several products, but they all run way too long or hog way too much CPU. Since I was bored, and finished (for now) the web page stuff, I decided to go back to my linux roots and write some scripts top handle it better. This is what I did with my day:
In my backup directory (/Volumes/bckp/) I created 7 folders (Mon, Tue, Wed, etc…) They correspond to the `date +%a` command. So instead of 7 scripts, I only need one. Each day will go to the new folder, erasing the backup from the week before. This gives me 7 full days of backups to choose from. If I don’t notice something has broken in the last week, I don’t deserve my data.
[alpha:~/bin] shay% more Alpha_*
::::::::::::::
Alpha_Home_BCKP
::::::::::::::
#!/bin/bash
rm -r /Volumes/bckp/`date +%a`/bckp_Alpha_Home_*
tar cvf /Volumes/bckp/`date +%a`/bckp_Alpha_Home_`date +%y%m-%d`.tar /Users/shay/Documents /Users/shay/Movies /Users/shay/Pictures /Users/shay/RED
ls -la /Volumes/bckp/`date +%a`/ |mail -s “Alpha Home Backup Complete” bckp@kinshay.com
exit
::::::::::::::
Alpha_Mail_BCKP
::::::::::::::
#!/bin/bash
rm -r /Volumes/bckp/`date +%a`/bckp_Alpha_Mail_*
tar cvf /Volumes/bckp/`date +%a`/bckp_Alpha_Mail_`date +%y%m-%d`.tar /Applications/4DWebSTAR
ls -la //Volumes/bckp/`date +%a`/ | mail -s “Alpha Mail Backup Complete” bckp@kinshay.com
exit
::::::::::::::
Alpha_Music_BCKP
::::::::::::::
#!/bin/bash
rm -r /Volumes/bckp/Music/bckp_Alpha_Music_*
tar cvf /Volumes/bckp/Music/bckp_Alpha_Music_`date +%y%m-%d`.tar /Users/shay/Music
ls -la /Volumes/bckp/Music/ | mail -s “Alpha Music Backup Complete” bckp@kinshay.com
exit
[alpha:~/bin] shay%
Currently listening to Sweet Jane by Cowboy Junkies