Automated MySQL backup on Ubuntu with cron
If you would like to take periodic backups of your MySQL database, you can do it easily with cron:
open crontab file:nano /etc/crontab
add the following line at the end of file:*/15 * * * * root /usr/bin/mysqldump -u<mysql_user> -p<mysql_password> <database_name> > <directory-to-save>-<file-prefix>`/bin/date +\%Y\%m\%d-\%H\%m`.sql
(the above line orders cron to get your backup every 15 minutes)
Add new comment