LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   rsync, SSH server on a different port (https://www.linuxquestions.org/questions/linux-server-73/rsync-ssh-server-on-a-different-port-535870/)

digen 03-08-2007 10:53 PM

rsync, SSH server on a different port
 
Hello Guys,

I'm trying to backup files using rsync from my remote server using the command given below. The problem is SSH on the remote server isn't listening on the default port, instead it's using a higher port number 8496.

Quote:

rsync -e ssh -avz --delete-after -p 8496 digen@myserver.com:/home/digen/Learning Learning
Public key authentication has been setup and is working fine if I specify the port with the argument "-P"

Quote:

ssh digen@myserver.com -p 8496
However, if I try using the same argument anywhere in the rsync command it doesn't work. Is it mandatory for using rsync that SSH server should be listening on the default port 22 ? I've gone through the man page of rsync briefly but I've been unable to find an argument for alternate SSH port. Your input is highly appreciated.

JimBass 03-09-2007 12:16 AM

2 Things I see. First off, I prefer to go the otherway, that is wrapping rsync inside of an ssh session rather than ssh within rsync, but the choice is yours. You may want to look at an absolutely brilliant piece of programming called backuppc, which can be found at http://backuppc.sourceforge.net . It is excellent at automating backups.

Secondly, your problem is solved by the rsync man page. You're mixing ssh and rsync commands horribly. In this case - "rsync -e ssh -avz --delete-after -p 8496", how is rsync supposed to sort out what is an rsync command and what is an ssh command? That's a mess and a half. You need to enclose all the ssh command within single or double quotes.

Check out the man page section with the obnoxious title "USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION", and also look around line 1240. I think you want your command to look like this -

Code:

rsync -e "ssh -p 8496" -avz digen@myserver.com:/home/digen/Learning Learning
You may also need to throw -l digen within the ssh quotes, depending on the rsync/rsyncd and ssh setup on the remote machine.

Peace,
JimBass

digen 03-09-2007 12:27 AM

w00t ! Thanks a ton JimBass. The command that you mentioned works like a charm. Thanks for pointing out my mistakes.

JimBass 03-09-2007 12:34 AM

No problem man, enjoy.

Peace,
JimBass


All times are GMT -5. The time now is 12:00 AM.