Best way to back up mysql database

John Almberg jalmberg at identry.com
Tue Sep 30 23:22:35 UTC 2008


>
> DATE=`date +%a`
> #
> echo $DATE
> #
> echo Backup Mysql database
> mysqldump -h localhost -u YOURSQLUSERID -pYOURPASSWORD YOURDATABASE  
> >/usr/somedirectory/somefile_$DATE.backup
> gzip -f /usr/somedirectory/somefile_$DATE.backup
> /usr/bin/at -f /usr/somedirectory/mysqlbackup.sh midnight

Ah, a much simpler solution than my ruby script. I hadn't thought to  
zip up the file before transferring it. That's an improvement I must  
add.

Thanks: John


More information about the freebsd-questions mailing list