NYCPHP Meetup

NYPHP.org

[nycphp-talk] Scripting to get a backup of yourcurrent MySQL database.

Ajai Khattri ajai at bitblit.net
Wed Oct 3 23:42:11 EDT 2007


On Wed, 3 Oct 2007, Ben Sgro \(ProjectSkyLine\) wrote:

> I just came into this conversation mid way, but I wanted to include a script 
> I use
> via cron to do mysql backups. Not sure if someone already provided this.
> 
> [sk at tinman ~]$ crontab -l
> 0 */23 * * * /path/to/sql_backup.sh
> 
> [sk at tinman ~]$ cat sql_backup.sh
> DATE=`date '+%m%d%Y'`
> DUMPFILE="/path/to/all_databases-$DATE.sql.gz"
> /usr/bin/mysqldump --all-databases --user=root --password=changeme | gzip > 
> $\
> DUMPFILE


Or avoid re-invention and use automysqlbackup.
http://sourceforge.net/projects/automysqlbackup/



-- 
Aj.




More information about the talk mailing list