?

Log in

No account? Create an account

Previous Entry | Next Entry

ph34r m4 r00tly p0w3rz!

#!/bin/bash
LCL=backup-full.tar.gz
NEW=`date +'%Y.%m.%d'`-full.tar.gz
OLD=`date --date='3 days ago' +'%Y.%m.%d'`-full.tar.gz

cd /usr/backup
rm $LCL
nice tar czf $LCL --exclude=/usr/backup/$LCL /lib /opt /root /usr \
/bin /home /sbin /var /boot /etc /initrd /sys /vmlinuz
chown root:brent $LCL
chmod 640 $LCL
nice smbclient //BRENT/BACKUP -U BRENT%<password> -W LAYOR -c "rm $OLD; put $LCL $NEW"
Too bad /usr is the only partition big enough to hold a compressed tarball of the entire drive. Now to figure out incremental backups...