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

ssh issues #17

Open marcobarbosa opened 9 years ago

marcobarbosa commented 9 years ago

Hi,

I have 2 issues when running the script with my current SSH setup.

First, the test_ssh fails for some reason:

Checking if SSH connection is working...
ssh -q <user>@<host> exit
<user>@<host>'s password:
TERM environment variable not set.
Test failed. Trying again...
ssh -q -o BatchMode=yes -o ConnectTimeout=15 <user>@<host> echo ok 2>&1
Error: could not connect to host. Confirm that the SSH connection, <user>@<host>, is working.

My host is not properly setup and I get prompted to enter the SSH password, could that be why?

So I tried to bypass it by commenting it out from the "pull" list of commands and it worked until do_remote_backup.

Checking the source code I can see it fails also because of ssh: echo "ssh -qt $ssh_port$r_user@$r_host cd $r_web_dir; chmod +x $(basename $0); ./$(basename $0) backup_remote_db;"

To get past this I had to manually make a chmod +x in the script in the server and then everything worked like a charm.

Any ideas why? Possibly just an issue with my setup but it would be good to know why :)