Skip to content

Commit 6ffe520

Browse files
authoredOct 1, 2024
Merge pull request #1610 from synyx/backup-fix-excluded-dbs
Fix backup/rotation with multiple excluded databases
2 parents ed18548 + 7d90921 commit 6ffe520

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎spec/classes/mysql_backup_mysqldump_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ class { 'mysql::server': }
7676
let(:params) do
7777
{
7878
'file_per_database' => true,
79-
'excludedatabases' => ['information_schema']
79+
'excludedatabases' => ['information_schema', 'performance_schema']
8080
}.merge(default_params)
8181
end
8282

8383
it {
8484
expect(subject).to contain_file('mysqlbackup.sh').with_content(
85-
%r{information_schema},
85+
%r{information_schema\\\|performance_schema},
8686
)
8787
}
8888
end

‎templates/mysqlbackup.sh.epp

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ cleanup
8484
<% if $excludedatabases.empty { -%>
8585
mysql --defaults-extra-file=$TMPFILE -s -r -N -e 'SHOW DATABASES' | while read dbname
8686
<%} else {-%>
87-
mysql --defaults-extra-file=$TMPFILE -s -r -N -e 'SHOW DATABASES' | grep -v '^\(<%= $excludedatabases.join('|') %>\)$' | while read dbname
87+
mysql --defaults-extra-file=$TMPFILE -s -r -N -e 'SHOW DATABASES' | grep -v '^\(<%= $excludedatabases.join('\\|') %>\)$' | while read dbname
8888
<% } -%>
8989
do
9090
<%= $backupmethod %> --defaults-extra-file=$TMPFILE --opt --flush-logs --single-transaction \

0 commit comments

Comments
 (0)