Brent Dax (brentdax) wrote,
Brent Dax
brentdax

  • Mood:

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...
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments