Changed backupdatabases default from false to []

This commit is contained in:
Casey Feskens 2013-08-15 06:04:14 -07:00
parent 359d88175c
commit ad479e6a81
2 changed files with 5 additions and 5 deletions

View file

@ -33,7 +33,7 @@ class mysql::backup (
$backupcompress = true,
$backuprotate = 30,
$delete_before_dump = false,
$backupdatabases = false,
$backupdatabases = [],
$ensure = 'present'
) {

View file

@ -31,14 +31,14 @@ cleanup()
cleanup
<% end -%>
<% if @backupdatabases -%>
<% if @backupdatabases.empty? -%>
mysqldump -u${USER} -p${PASS} --opt --flush-logs --single-transaction \
--all-databases <% if @backupcompress %>| bzcat -zc <% end %>> ${DIR}/${PREFIX}`date +%Y%m%d-%H%M%S`.sql<% if @backupcompress %>.bz2<% end %>
<% else -%>
<% @backupdatabases.each do |db| -%>
mysqldump -u${USER} -p${PASS} --opt --flush-logs --single-transaction \
<%= db %><% if @backupcompress %>| bzcat -zc <% end %>> ${DIR}/${PREFIX}<%= db %>_`date +%Y%m%d-%H%M%S`.sql<% if @backupcompress %>.bz2<% end %>
<% end -%>
<% else -%>
mysqldump -u${USER} -p${PASS} --opt --flush-logs --single-transaction \
--all-databases <% if @backupcompress %>| bzcat -zc <% end %>> ${DIR}/${PREFIX}`date +%Y%m%d-%H%M%S`.sql<% if @backupcompress %>.bz2<% end %>
<% end -%>
<% unless @delete_before_dump -%>