MySQL Backup script
Doing this on FreeBSD so you might need to modify the bash location for other OS choices
#!/usr/local/bin/bash
backupdir=/home/backup/
backupfile=`date +backup-%d-%m-%y_%H.sql`
tarfile=mysqlbackup.tar
cd $backupdir
mysqldump --opt -A -h localhost --password=***** -u root > $backupfile
gunzip "$tarfile".gz
tar rf $tarfile $backupfile &> /dev/null
gzip $tarfile
rm $backupfile
| Print article | This entry was posted by Mikeal on 09/07/11 at 10:19:00 pm . Follow any responses to this post through RSS 2.0. |