welaika / wordmove

Multi-stage command line deploy/mirroring and task runner for Wordpress
https://wptools.it/wordmove
MIT License
1.87k stars 167 forks source link

sudo on remote #375

Closed trikon closed 7 years ago

trikon commented 7 years ago

Hello, Tell me please, is it possible to run remote commands(mysqldump) as sudo?

i use wordmove pull -e production -d command.

Ex: sudo mysqldump --host=localhost --user=usr1 --password=pwd1 --result-file="/usr/share/wordpress/wp-content/dump.sql" somedb

Thanks.

alessandro-fazzi commented 7 years ago

I'm sorry, but Wordmove cannot do this. If you have admin access to the server - as I think - you could write an executable wrapper to your mysqldump command; on my machine I'd do

cd /usr/ocal/bin
mv mysqldump mysqldump_real
touch mysqldump
chmod u+x mysqldump

And I'd write something like

#!/usr/bin/env bash

sudo /usr/local/bin/mysqldump_real

in the newly created script. No other ideas.

Cheers