How to backup a MySql database To backup all your databases from MySql, I made the this script. You can run this script from your crontab. Run this every night and it will dump all of your databases added with a date into the directory /backup/sql You can also remove the very old ones by crontab. My crontab looks like the following: 0 0 * * * find /backup/sql/ -mtime +5 -exec rm -rf {} \; 0 0 * * * /usr/local/bin/sqlbackup