Periodically back up MySQL with a Shell Script
There are many advantages to using the shell, one is making backups. With the following code and a cron job, periodically backing up MySQL databases is a breeze.
#!/bin/sh
mkdir `date +%m-%d-%y-%Hx%M`
cd `date +%m-%d-%y-%Hx%M`
mysqldump -h localhost -u user -ppassword dbname > file.sql
Tags: backup, bash, mysql, script, shell
This entry was posted
on Saturday, April 19th, 2008 at 10:42 am and is filed under Development.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.