Skip to content

Commit 5052906

Browse files
author
Erick Banks
authored
Merge pull request #1222 from baldurmen/cron_xtrabackup
Fix errors for /bin/sh with the xtrabackup cron
2 parents 01f65f9 + 8e6eef0 commit 5052906

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

manifests/backup/xtrabackup.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
$daily_cron_data = ($incremental_backups) ? {
6565
true => {
66-
'directories' => "--incremental-basedir=${backupdir} --target-dir=${backupdir}/`date +%F_%H-%M-%S`",
66+
'directories' => "--incremental-basedir=${backupdir} --target-dir=${backupdir}/$(date +\\%F_\\%H-\\%M-\\%S)",
6767
'weekday' => '1-6',
6868
},
6969
false => {

spec/classes/mysql_backup_xtrabackup_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class { 'mysql::server': }
4444
is_expected.to contain_cron('xtrabackup-daily')
4545
.with(
4646
ensure: 'present',
47-
command: '/usr/local/sbin/xtrabackup.sh --incremental-basedir=/tmp --target-dir=/tmp/`date +%F_%H-%M-%S` --backup',
47+
command: '/usr/local/sbin/xtrabackup.sh --incremental-basedir=/tmp --target-dir=/tmp/$(date +\%F_\%H-\%M-\%S) --backup',
4848
user: 'root',
4949
hour: '23',
5050
minute: '5',
@@ -101,7 +101,7 @@ class { 'mysql::server': }
101101
is_expected.to contain_cron('xtrabackup-daily')
102102
.with(
103103
ensure: 'present',
104-
command: '/usr/local/sbin/xtrabackup.sh --incremental-basedir=/tmp --target-dir=/tmp/`date +%F_%H-%M-%S` --backup --skip-ssl',
104+
command: '/usr/local/sbin/xtrabackup.sh --incremental-basedir=/tmp --target-dir=/tmp/$(date +\%F_\%H-\%M-\%S) --backup --skip-ssl',
105105
user: 'root',
106106
hour: '23',
107107
minute: '5',

0 commit comments

Comments
 (0)