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

Syntax error #7

Open wolfgangschoeffel opened 10 years ago

wolfgangschoeffel commented 10 years ago

When I try running the script (on my MacBook Pro, Mavericks) I get a syntax error:

./syncdb: line 267: syntax error near unexpected token `;'
./syncdb: line 267: `        return_local_standard();'
jplew commented 10 years ago

Hi Wolfgang. Thanks for the heads up. I just fixed it, do you mind pulling again and checking?

wolfgangschoeffel commented 10 years ago

Hi JP Lew, thank you for fixing the error. But I am afraid it is still not working for me. But don’t mind. Maybe it is a Problem with my settings. I also tried out an older version of your script. It seemed to work but then suddenly the ssh connection was lost. Now with the latest version I get this output:

./syncdb

SyncDB v0.2.2 > push

Checking if SSH connection is working...

ssh -q xxx@xxx.xxx.xx exit

Success: SSH connection is working.

Fetching local database login details...

Backing up the local database...
/Applications/MAMP/Library/bin/mysqldump -u -p -h   | bzip2 -c > 140507-2112-.mssql.bz2

mysqldump: Got error: 1046: No database selected when selecting the database

Error: Database was not backed up. There is a problem with your local MySQL details. Exiting.
wolfgangschoeffel commented 10 years ago

Can it be that there is an echo missing on line 635?

 "${l_mysqldump:-mysqldump}" "-u$l_db_user" "-p$l_db_pass" -h "$l_db_host" "$l_db_name" | bzip2 -c > "${l_bak_name1}.bz2"
jplew commented 10 years ago

Can you please try the new version I just posted? I apologize for the inconvenience, a bug slipped in where the script was failing to grep the wp-config file correctly, causing it to come up with blank values for all your DB settings. It should work now (hopefully). :)