Daily Database backup using Cron Job

后端 未结 2 1700
不知归路
不知归路 2020-12-29 11:34

Hi i want to take database backup at daily mid night using cron job... and the name of database backup should append with current date... the format of backup file should

2条回答
  •  轮回少年
    2020-12-29 11:55

    something like

    0 0 * * * /path/to/mysqldump ... > /path/to/backup/mydata_$( date +"%Y_%m_%d" ).sql
    

    should work.

    Please read

    • man date
    • man 5 crontab

提交回复
热议问题