File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 68
68
' weekday' => ' 1-6' ,
69
69
},
70
70
false => {
71
- ' directories' => " --target-dir=${backupdir} " ,
71
+ ' directories' => " --target-dir=${backupdir} /$(date + \\ %F_ \\ %H- \\ %M- \\ %S) " ,
72
72
' weekday' => ' *' ,
73
73
},
74
74
}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class { 'mysql::server': }
31
31
is_expected . to contain_cron ( 'xtrabackup-weekly' )
32
32
. with (
33
33
ensure : 'present' ,
34
- command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp --backup' ,
34
+ command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F_\%H-\%M-\%S) --backup' ,
35
35
user : 'root' ,
36
36
hour : '23' ,
37
37
minute : '5' ,
@@ -88,7 +88,7 @@ class { 'mysql::server': }
88
88
is_expected . to contain_cron ( 'xtrabackup-weekly' )
89
89
. with (
90
90
ensure : 'present' ,
91
- command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp --backup --skip-ssl' ,
91
+ command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F_\%H-\%M-\%S) --backup --skip-ssl' ,
92
92
user : 'root' ,
93
93
hour : '23' ,
94
94
minute : '5' ,
@@ -123,7 +123,7 @@ class { 'mysql::server': }
123
123
it 'contains the daily cronjob with all weekdays' do
124
124
is_expected . to contain_cron ( 'xtrabackup-daily' ) . with (
125
125
ensure : 'present' ,
126
- command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp --backup' ,
126
+ command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F_\%H-\%M-\%S) --backup' ,
127
127
user : 'root' ,
128
128
hour : '23' ,
129
129
minute : '5' ,
Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ set -o pipefail
26
26
cleanup()
27
27
{
28
28
<%- if @kernel == 'SunOS' -%>
29
- gfind "${DIR}/" -maxdepth 1 -type f -name "${PREFIX}*.sql*" - mtime +${ROTATE} -print0 | gxargs -0 -r rm -f
29
+ gfind "${DIR}/" -mindepth 1 -maxdepth 1 - mtime +${ROTATE} -print0 | gxargs -0 -r rm -rf
30
30
<%- else -%>
31
- find "${DIR}/" -maxdepth 1 -type f -name "${PREFIX}*.sql*" - mtime +${ROTATE} -print0 | xargs -0 -r rm -f
31
+ find "${DIR}/" -mindepth 1 -maxdepth 1 - mtime +${ROTATE} -print0 | xargs -0 -r rm -rf
32
32
<%- end -%>
33
33
}
34
34
You can’t perform that action at this time.
0 commit comments