Mysql backup with cron

To back up a mysql database, you only have to add a job to the job list the cron utility (or/etc/crontab file manually).

Video tutorial on how to work with cron, you can see here.

And the string job should look like this (the file with the dump database is created in the directory/mnt/data):

* * * * */usr/bin/mysqldump-u imâ_pol′zovatelâ_bazy-p password database_name >/mnt/data/database.sql

You can take advantage of the opportunity to archive the database dump file after it is created. In this case, the job must be of the form:

* * * * */usr/bin/mysqldump-u imâ_pol′zovatelâ_bazy_dannyh-p password database_name | gzip >/mnt/data/database.gz

Depending on your needs, you can change the backup mysql database to the desired time.