Closed marcobarbosa closed 9 years ago
Hi Marco:
thanks for submitting the bug. Out of curiosity, which version of bash is your server using? To find out type this: bash --version
Not sure why it's giving that error, all we are doing is suppressing output by redirecting it to /dev/null—it's quite standard.
Do you mind running a test for me? Change that line by removing the offensive syntax, like this: sql_show="show databases; create database if not exists $r_db_name;"
Is it still giving the same error? Thank. -JP
I just pushed an updated, I noticed there was an unrelated error in the script which would have prevented it from working anyway. Before you test again can you download the new version of syncdb? Thanks.
Thanks jplew! I just tested it again.
After the show databases; create database if not exists $r_db_name
it feels like i have to hit enter in the console to get going, then right after I get:
./syncdb: line 957: $1: unbound variable
I get no errors after this notice but the database is not pushed (as the old one remains).
There was a problem with the variable substitution, thanks again for bringing this to my attention.
I have attempted to fix this bug in the latest version. When you get the chance, please download the newest version and try again. It's not required but you may want to update your syncdb-config too (I just added a new parameter at the bottom, which enables auto-updating). Thanks!
Ok, I tried again and this time I got:
Enter password: Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
It's weird because I didn't get this error before..
Unrelated question: Is there a reason why you don't download the plugins folder in the rsync_pull and rsync_push? I would be willing to give you a pull request with that suggestion (should be really easy to duplicate what you have for uploads) if you find it interesting.
Regarding that error, can you please do me a favor and send me the error log? Try executing the script again like this: bash -x ./syncdb
then post the gist (https://gist.github.com/).
Secondly, I personally prefer not to sync the plugins folder via rsync, because I prefer to keep all the plugins and themes in version control and synced via git. Plugins and themes work hand in hand, and are code, so they lend themselves better to git. Uploads (media) on the other hand don't lend themselves to version control as well, because git isn't made for binaries.
Of course, if you prefer not to go that route, then rsync can handle plugins no problem. What I would do is change the "uploads" folder to wp-content/
, then exclude the themes
folder, and and anything else you don't want rsync'ed. Hope that makes sense.
Please let me know.
Hey @jplew
I've just tested the script again and it works like a charm. Using a different hosting though.
Hi,
First of all thanks for this excellent script! I'm really impressed. I'm running into trouble with a hosting that doesn't give me "DROP" privileges. So I've added here:
no_drop=true # set to true if your host sucks
...because my host sucks :D
Then I get this:
Which is related to this:
Any ideas on where this syntax error is? Ill keep looking.