summaryrefslogtreecommitdiff
path: root/manifests/server/cron
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/server/cron')
-rw-r--r--manifests/server/cron/backup.pp8
1 files changed, 7 insertions, 1 deletions
diff --git a/manifests/server/cron/backup.pp b/manifests/server/cron/backup.pp
index 671ad9c..2b9dc6c 100644
--- a/manifests/server/cron/backup.pp
+++ b/manifests/server/cron/backup.pp
@@ -11,8 +11,14 @@ class mysql::server::cron::backup {
}
}
+ if versioncmp($::mysql_version,'5.1.68') > 0 {
+ $backup_command = "/usr/bin/mysqldump --default-character-set=utf8 --all-databases --create-options --flush-logs --lock-tables --single-transaction --events --ignore-table=mysql.event | gzip > ${mysql::server::backup_dir}/mysqldump.sql.gz && chmod 600 ${mysql::server::backup_dir}/mysqldump.sql.gz"
+ } else {
+ $backup_command = "/usr/bin/mysqldump --default-character-set=utf8 --all-databases --create-options --flush-logs --lock-tables --single-transaction | gzip > ${mysql::server::backup_dir}/mysqldump.sql.gz && chmod 600 ${mysql::server::backup_dir}/mysqldump.sql.gz"
+ }
+
cron { 'mysql_backup_cron':
- command => "/usr/bin/mysqldump --default-character-set=utf8 --all-databases --create-options --flush-logs --lock-tables --single-transaction | gzip > ${mysql::server::backup_dir}/mysqldump.sql.gz && chmod 600 ${mysql::server::backup_dir}/mysqldump.sql.gz",
+ command => $backup_command,
user => 'root',
minute => 0,
hour => 1,