Friday, June 25, 2004
Here's a nice and handy bash script I use to backup my Powerbook to my Linux server...
#!/bin/bash
export bkup="Now rsyncing"
export buSrc='/Users/emillan'
export buDest='/Volumes/emillan/backup/nanobook'
export nbDir='/Users/emillan/Documents/Backup/nanoBook'
dir[1]="/Documents/Personal"
dest[1]="/Documents"
dir[2]="/Documents/Reference"
dest[2]="/Documents"
dir[3]="/Documents/Backup"
dest[3]="/Documents"
dir[4]="/Pictures"
dest[4]=""
dir[5]="/Music"
dest[5]=""
dir[6]="/Sites"
dest[6]=""
dir[7]="/Library/Mail"
dest[7]="/Library"
clear;
echo -e "************************************************\r";
echo -e "** Now creating archives on 'nanoBook'... **\r";
echo -e "************************************************";
#Creation of tars
echo -e "\nNow archiving '/etc'...";
tar -czf $nbDir/etc.tar.gz /private/etc;
echo -e "\nNow archiving 'home items'...";
tar -czf $nbDir/home.tar.gz ~/.bashrc ~/.bash_profile ~/.ssh ~/.vimrc ~/.cvspass;
echo -e "\nNow archiving 'Library/Application Support'...";
tar -czf $nbDir/application_support.tar.gz ~/Library/Application*;
echo -e "\nNow archiving 'Library/Preferences'...";
tar -czf $nbDir/preferences.tar.gz ~/Library/Preferences;
echo -e "\nNow archiving 'Library/Calendars'...";
tar -czf $nbDir/calendars.tar.gz ~/Library/Calendars;
echo -e "\n************************************************\r";
echo -e "** Now backing up 'nanoBook' to 'nanotron'... **\r";
echo -e "************************************************";
#Copy to Nanotron
for ((a=1; a < 8; a++))
do
echo -e "\n$bkup '${dir[a]}'...";
rsync -aL --delete "$buSrc${dir[a]}" "$buDest${dest[a]}";
done
echo -e "\n*********************************\r";
echo -e "** Backup process is complete. **\r";
echo -e "*********************************\n";
#!/bin/bash
export bkup="Now rsyncing"
export buSrc='/Users/emillan'
export buDest='/Volumes/emillan/backup/nanobook'
export nbDir='/Users/emillan/Documents/Backup/nanoBook'
dir[1]="/Documents/Personal"
dest[1]="/Documents"
dir[2]="/Documents/Reference"
dest[2]="/Documents"
dir[3]="/Documents/Backup"
dest[3]="/Documents"
dir[4]="/Pictures"
dest[4]=""
dir[5]="/Music"
dest[5]=""
dir[6]="/Sites"
dest[6]=""
dir[7]="/Library/Mail"
dest[7]="/Library"
clear;
echo -e "************************************************\r";
echo -e "** Now creating archives on 'nanoBook'... **\r";
echo -e "************************************************";
#Creation of tars
echo -e "\nNow archiving '/etc'...";
tar -czf $nbDir/etc.tar.gz /private/etc;
echo -e "\nNow archiving 'home items'...";
tar -czf $nbDir/home.tar.gz ~/.bashrc ~/.bash_profile ~/.ssh ~/.vimrc ~/.cvspass;
echo -e "\nNow archiving 'Library/Application Support'...";
tar -czf $nbDir/application_support.tar.gz ~/Library/Application*;
echo -e "\nNow archiving 'Library/Preferences'...";
tar -czf $nbDir/preferences.tar.gz ~/Library/Preferences;
echo -e "\nNow archiving 'Library/Calendars'...";
tar -czf $nbDir/calendars.tar.gz ~/Library/Calendars;
echo -e "\n************************************************\r";
echo -e "** Now backing up 'nanoBook' to 'nanotron'... **\r";
echo -e "************************************************";
#Copy to Nanotron
for ((a=1; a < 8; a++))
do
echo -e "\n$bkup '${dir[a]}'...";
rsync -aL --delete "$buSrc${dir[a]}" "$buDest${dest[a]}";
done
echo -e "\n*********************************\r";
echo -e "** Backup process is complete. **\r";
echo -e "*********************************\n";
Posted by Ernest Millan at 2:20 PM
Post a Comment |
1 comment
Chris Holland said...
"o this owns. i just may use that soon-ish :D"
6:48 PM, June 25, 2004