LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-08-2007, 10:53 PM   #1
digen
Member
 
Registered: Dec 2005
Location: India
Distribution: Ubuntu Feisty Fawn
Posts: 107

Rep: Reputation: 15
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.
 
Old 03-09-2007, 12:16 AM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
Old 03-09-2007, 12:27 AM   #3
digen
Member
 
Registered: Dec 2005
Location: India
Distribution: Ubuntu Feisty Fawn
Posts: 107

Original Poster
Rep: Reputation: 15
w00t ! Thanks a ton JimBass. The command that you mentioned works like a charm. Thanks for pointing out my mistakes.
 
Old 03-09-2007, 12:34 AM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
No problem man, enjoy.

Peace,
JimBass
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync +ssh on different port? masterross Linux - Software 41 08-09-2019 03:57 PM
rsync->ssh port lackluster Linux - Software 2 05-27-2007 08:42 PM
rsync using alternative ssh port va1damar Linux - Networking 5 01-29-2007 02:22 PM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM
rsync and ssh port ohcarol Linux - Software 2 12-22-2004 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration