How to backup domains to remote server from command line?

I am trying to backup and restore domains from the command line from my production server to my staging server using SSH. I am having trouble with the syntax of --dest option. My servers are using non-standard port number and I haven’t figured out the correct syntax. So far I’ve tried:

virtualmin backup-domain --feature dir --feature mysql --domain cottageparkrentals.com --dest ssh://myloginname:mypassword@myserver.net:/home/myusername/mydomain.com.tar.gz

virtualmin backup-domain --feature dir --feature mysql --domain cottageparkrentals.com --dest ssh://myloginname:mypassword@myserver.net:/home/myusername/mydomain.com.tar.gz:9999

virtualmin backup-domain --feature dir --feature mysql --domain cottageparkrentals.com --dest ‘scp -oPort=9999 myloginname:mypassword@myserver.net:/home/myusername/mydomain.com.tar.gz’

And many other permutations. Can anyone give me some guidance here? I use ssh and scp between these servers from the command line without any problem, though I do use the -oPort=9999 option to specify the non-standard port. I am setup for passwordless login using server keys and most often use scp and ssh without a password.

Any assistance will be greatly appreciated!

Howdy,

Well, when using the GUI, in the hostname field, you would list a non-standard port by specifying “hostname:port”.

You may want to try something like “myloginname:mypassword@myserver.net:PORT:/path”, or something similar.

-Eric

No Joy… I tried that. I get this error message:

Failed to open /usr/libexec/webmin/virtual-server/ssh://mynamel@myserver.net:9022/home/me/mydomain.com.tar.gz for writing : No such file or directory

Oh, and I tried it with the colon after the port, too… no luck.

usage:

–dest ssh://$USER:$PASS@$HOST:$PORT:$PATH

i.e. ssh://userCOLONpass@hostCOLONportCOLONpath

(just what andreychek said :slight_smile:

I believe user and pass (and path) are required.