
# Backup directory to use (2011/08/31 for 08.31.2011)
BKLOG="/backups/$YEAR/$MONTH/$DAY.log"
ARRPOS=0
DRIVE=('sda' 'sdb') BACKUP=('/' '/pub') SDAEX=('/media' '/tmp' '/dev' '/proc' '/sys' '/mnt' '/pub' '/var/cache' '/backups') touch $BKLOG
echo "To: someone@somewhere.com" > $BKLOG
# Checks to see if day = 1, and if so, backs up the last month's backups
tar -cpPzf /backups/$YEAR/$OLD.tar.gz /backups/$YEAR/$OLD/
# Cycle through each drive and back up each
SD=$( { time tar -cpPzf $BKDIR/$d.tar.gz $EX ${BACKUP[$ARRPOS]}; } 2>&1 )[ehansen@sfu ~]$ time
for d in "${DRIVE[@]}"; do # By default, at least don't backup lost+found directories
# Mail this script out...ssmtp for GMail accounts, otherwise change for appropriate MTA