LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 06-14-2007, 12:40 PM   #1
kgopal30
LQ Newbie
 
Registered: Jun 2007
Posts: 5

Rep: Reputation: 0
how do we specify the port number in rsync?


I'm using the following command :
rsync -av --delete $MAIN_SERVER:/tmp/test /tmp

here I want to specify the port number for the source server(ie main_server)..cos the port specified here is not default 22, so, I wanted to use port 3022 there..

what should be the command ? Please guide me
 
Old 06-14-2007, 01:12 PM   #2
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
According to the man page, you need the option "--port=PORT". 'man rsync' would have told you this!
 
Old 06-14-2007, 04:03 PM   #3
ABL
Member
 
Registered: Mar 2005
Location: NYC
Distribution: CentOS 5
Posts: 54

Rep: Reputation: 16
Quote:
Originally Posted by kgopal30
I'm using the following command :
rsync -av --delete $MAIN_SERVER:/tmp/test /tmp

here I want to specify the port number for the source server(ie main_server)..cos the port specified here is not default 22, so, I wanted to use port 3022 there..

what should be the command ? Please guide me
You should be able to use
rsync -av --delete $MAIN_SERVER:$PORTNUM/tmp/test /tmp

or rsync -av --delete --port=$PORTNUM $MAIN_SERVER:/tmp/test /tmp

(Sorry, Gethyn. I had this sitting ready to go before you had posted, but I just realized that I hadn't submitted. Once I did, I saw your post).

--Alden

Last edited by ABL; 06-14-2007 at 04:12 PM.
 
Old 06-14-2007, 11:44 PM   #4
kgopal30
LQ Newbie
 
Registered: Jun 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ABL
You should be able to use
rsync -av --delete $MAIN_SERVER:$PORTNUM/tmp/test /tmp

or rsync -av --delete --port=$PORTNUM $MAIN_SERVER:/tmp/test /tmp

(Sorry, Gethyn. I had this sitting ready to go before you had posted, but I just realized that I hadn't submitted. Once I did, I saw your post).

--Alden

Hi Thanks..

when I tried this, I get the following message:

ssh: : Name or service not known
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)
what should be done to rectify this?
 
Old 06-15-2007, 03:25 AM   #5
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Never seen that error before. It might be that rsync is unable to find the ssh binary on the server. You could try the option "--rsh=/path/to/binary".
 
Old 06-17-2007, 01:48 AM   #6
kgopal30
LQ Newbie
 
Registered: Jun 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Gethyn
Never seen that error before. It might be that rsync is unable to find the ssh binary on the server. You could try the option "--rsh=/path/to/binary".

Ok..this is solved now..I've to use these lines before executing..

RSYNC_RSH=rsh
export RSYNC_RSH

Then I dont get the error. thanks for your support..
 
  


Reply



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, SSH server on a different port digen Linux - Server 3 03-09-2007 12:34 AM
rsync using alternative ssh port va1damar Linux - Networking 5 01-29-2007 02:22 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 12:01 AM.

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