Backs up all databases, saves the last 4 copies.
!/bin/bash
# modify the following :
export DB_BACKUP=”/home/user/mysql_backup/”
export DB_USER=”root”
export DB_PASSWD=”********”echo “MySQL_Backup”
echo “———————-”
echo “* Rotating 4 backups…”
rm -rf $DB_BACKUP/04
mv $DB_BACKUP/03 $DB_BACKUP/04
mv $DB_BACKUP/02 $DB_BACKUP/03
mv $DB_BACKUP/01 $DB_BACKUP/02
mkdir $DB_BACKUP/01echo “* Creating new backup…”
mysqldump –user=$DB_USER –password=$DB_PASSWD –all-databases | bzip2 > $DB_BACKUP/01/mysql-`date +%Y-%m-%d`.bz2
echo “———————-”
echo “Done”
exit 0

October 14th, 2010 on 02:59
Yes… i also really like to visit this new place, your idea is good.
October 14th, 2010 on 15:52
Of course, what a great site and informative posts, I will add backlink – bookmark this site? Regards, Reader.
October 16th, 2010 on 20:59
I cannot thank you enough for the blog article.Thanks Again. Will read on…
October 18th, 2010 on 11:52
thanks for the post