Use double quotes for mysql backup
Previously we were trying to run a mysql backup before we attempted migrations, just in case something went wrong. However, the command was failing because the $db_name variable wasn't being properly interpolated. This commit fixes that by using " around the command instead of '. Additionally, pipefail is set on the exec to prevent this from succeeding but not working in the future. Change-Id: I746a9f0ae722802419f36f80626c3a6f4186bad6
This commit is contained in:
parent
ab6e196aa4
commit
1cd42a389f
|
@ -41,7 +41,7 @@ class subunit2sql::server (
|
|||
}
|
||||
|
||||
exec { 'backup_subunit2sql_db':
|
||||
command => 'mysqldump --defaults-file=/etc/subunit2sql-my.cnf --opt $db_name | gzip -9 > /opt/subunit2sql.sql.gz',
|
||||
command => "set -o pipefail; mysqldump --defaults-file=/etc/subunit2sql-my.cnf --opt ${db_name} | gzip -9 > /opt/subunit2sql.sql.gz",
|
||||
path => '/usr/local/bin:/usr/bin:/bin/',
|
||||
subscribe => Package['subunit2sql'],
|
||||
require => File['/etc/subunit2sql-my.cnf'],
|
||||
|
|
Loading…
Reference in New Issue