Skip to content

Commit

Permalink
Password escaping for Mysql dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
AntJanus committed Mar 24, 2014
1 parent 42255aa commit 803f75b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deployment/lib/sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 803f75b

Please sign in to comment.