Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Password escaping for mysql dumps #113

Merged
merged 1 commit into from
May 12, 2014

Conversation

AntJanus
Copy link
Contributor

Resolves #110

@AntJanus AntJanus changed the title Password escaping for mysql dumpbs Password escaping for mysql dumps Mar 31, 2014
@@ -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'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work just as well to use escaped single-quotes?

system "vagrant ssh local -c 'cd /vagrant && mysqldump -u\'#{db_user}\' -p\'#{db_password}\' --opt --databases \'#{db_name}\' | gzip --rsyncable > #{backup_name}.gz'"

@ericclemmons ericclemmons changed the title Password escaping for mysql dumps [RFC] Password escaping for mysql dumps May 12, 2014
ericclemmons added a commit that referenced this pull request May 12, 2014
[RFC] Password escaping for mysql dumps
@ericclemmons ericclemmons merged commit ba673ce into master May 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Escape single-quotes with genesis:db:up
2 participants