#!/bin/bash
# set chmod 700 to /backup for security reasons
cd /backup
FILENAME=`date +%d%b%Y`-mysql_alldb.tar.gz.sec
mysqldump --single-transaction -u backup -pmysqlpasswd --all-databases > backup.sql
tar -cf - backup.sql | gzip -c > backup.tar.gz
openssl des -in backup.tar.gz -out $FILENAME -pass pass:cryptpasswd
scp $FILENAME backup@backupsvr:/backup/srv1/db
echo `md5sum $FILENAME` >> md5sum.log
rm backup.sql backup.tar.gz $FILENAME
Nav komentāru:
Ierakstīt komentāru