jplew / SyncDB

Bash script meant to take the tedium out of deploying and updating database-driven (eg Wordpress) websites. It rapidly synchronizes local and remote versions of a MySQL database, performs the necessary search and replace queries, then synchronizes all your uploads/binaries.
MIT License
234 stars 41 forks source link

download_remote_db fails #19

Open spikyjt opened 9 years ago

spikyjt commented 9 years ago

Running download_remote_db throws an error, which spits out the usage info for scp and then says the download didn't work.

The problem is that the scp port is added to the command as a quoted string, but it should not be quoted. Line 895 (upload_script) does it the right way: ${scp_port} whereas line 735 is incorrect: "$scp_port". I guess this might work in some environments, but it doesn't in mine (bash, Ubuntu 12.04).

The confusing thing is that because you echo the command to execute first, it looks like it should be ok, but what actually gets executed is (assuming port 8822 for ssh):

scp -q "-P 123 "user@host:~/web_dir/.bak/bakname.bz2 .

The curly brackets method ${scp_port} works fine.

marcobarbosa commented 9 years ago

Would https://github.com/jplew/SyncDB/pull/14 fix this issue?