The command for back up a mysql database is:
15 2 * * * root mysqldump -u root -pPASSWORD --all-databases | gzip > /mnt/disk2/database_`data '+%m-%d-%Y'`.sql.gz
The first part is "15 2 * * *". The five fields mean "minute, hour, day of month, month, day of week" respectively. The character '*' stands for "any".
The next, "root", means "run following command as root account".
You can use cron job so that it takes backup daily.
No comments:
Post a Comment