From 344b80ea8b1c0252ce7dc06dcac74430c27e7049 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sun, 20 Dec 2015 15:28:22 +0100 Subject: [PATCH] library/roles/mysql/defaults/main.yml: MySQL backup minute and hour are now customizable. --- mysql/defaults/main.yml | 2 ++ mysql/files/mysql-backup.cron | 1 - mysql/templates/mysql-backup.cron.j2 | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) delete mode 100755 mysql/files/mysql-backup.cron create mode 100755 mysql/templates/mysql-backup.cron.j2 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