Skip to content

Commit 950cf9a

Browse files
committed
use $() instead of backtiks for command substitution, as it gives a more consistent behavior.
See https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03 for more details
1 parent 01f65f9 commit 950cf9a

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)