From 803f75bbba7d19d8fb1296fb64233500758bfec5 Mon Sep 17 00:00:00 2001 From: Antonin Januska Date: Mon, 24 Mar 2014 12:11:04 -0500 Subject: [PATCH] Password escaping for Mysql dumps --- deployment/lib/sync.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/lib/sync.rb b/deployment/lib/sync.rb index b8471a3..4fc833e 100644 --- a/deployment/lib/sync.rb +++ b/deployment/lib/sync.rb @@ -96,7 +96,7 @@ set :backup_path, "#{backup_dir}/#{backup_name}" system "vagrant up" - system "vagrant ssh local -c 'cd /vagrant && mysqldump -u\"#{db_user}\" -p\"#{db_password}\" --opt --databases \"#{db_name}\" | gzip --rsyncable > #{backup_name}.gz'" + system "vagrant ssh local -c 'cd /vagrant && mysqldump -u\"#{db_user}\" -p\"#{db_password.gsub('$', '\$')}\" --opt --databases \"#{db_name}\" | gzip --rsyncable > #{backup_name}.gz'" run "mkdir -p #{backup_dir}" top.upload "#{backup_name}.gz", "#{backup_path}.gz", :via => :scp