#! /bin/sh
cd /backup
TODAY=`date`
FILENAME=`date +%d%b%Y`-inc-htdir.tar.gz.sec
# Check last backup date
if [ -f lastbackup ]; then
LAST=`cat lastbackup`
else
LAST=$TODAY
fi
# Create .tar.gz
tar -czf htdir.tar.gz --after-date="$LAST" /var/www/htdocs
# Encode with SSL
openssl des -in htdir.tar.gz -out $FILENAME -pass pass:secpasswd
# Send to remote backup machine
scp $FILENAME backup@10.0.2.251:/backup/data/www/htdir
# Cleanup n' shit
echo `md5sum $FILENAME` >> md5sum.log
rm htdir.tar.gz $FILENAME
echo $TODAY > lastbackup
otrdiena, 2011. gada 12. aprīlis
Incremental htdir backup script.sh
Abonēt:
Ziņas (Atom)