diff --git a/mysql/defaults/main.yml b/mysql/defaults/main.yml index cdea08a8..ab0e8878 100644 --- a/mysql/defaults/main.yml +++ b/mysql/defaults/main.yml @@ -44,4 +44,6 @@ mysql_backup_logfile: '{{ mysql_backup_logdir }}/my_backup.log' mysql_backup_retain_copies: 15 mysql_backup_destdir: /var/lib/mysql-backup mysql_backup_exclude_list: "performance_schema" +mysql_backup_crontab_minute: 0 +mysql_backup_crontab_hour: 2 diff --git a/mysql/files/mysql-backup.cron b/mysql/files/mysql-backup.cron deleted file mode 100755 index c47340ca..00000000 --- a/mysql/files/mysql-backup.cron +++ /dev/null @@ -1 +0,0 @@ -0 0 * * * root /usr/local/bin/mysql-backup > /var/log/mysql-backup.log 2>&1 diff --git a/mysql/templates/mysql-backup.cron.j2 b/mysql/templates/mysql-backup.cron.j2 new file mode 100755 index 00000000..4586ab68 --- /dev/null +++ b/mysql/templates/mysql-backup.cron.j2 @@ -0,0 +1 @@ +{{ mysql_backup_crontab_minute }} {{ mysql_backup_crontab_hour }} * * * root /usr/local/bin/mysql-backup > /var/log/mysql-backup.log 2>&1