You are not logged in.

#1 2010-01-07 07:33:37

caelestis
Member
Registered: 2009-04-04
Posts: 88

rsync over sftp?

What would be the command to sync from the source of an sftp server (port 2222) to a directory on my hard drive and vice versa?
Right now I just use sshfs first and then rsync, but I was wondering if there is an easier way.

Offline

#2 2010-01-07 09:51:09

theDOC
Member
From: Aachen, Germany
Registered: 2009-06-18
Posts: 50

Re: rsync over sftp?

what does:

rsync -a --port 2222 user@host:/src/dir /dst/dir

and

rsync -a /src/dir --port 2222 user@host:/dst/dir

do?

Offline

#3 2010-01-07 21:15:08

caelestis
Member
Registered: 2009-04-04
Posts: 88

Re: rsync over sftp?

--port 2222 doesn't work so it tries 22 and times out.

Offline

#4 2010-01-07 22:27:31

pointone
Wiki Admin
From: Waterloo, ON
Registered: 2008-02-21
Posts: 379

Re: rsync over sftp?

Check the man page. The correct syntax is --port=PORT.


M*cr*s*ft: Who needs quality when you have marketing?

Offline

#5 2010-01-07 22:54:14

caelestis
Member
Registered: 2009-04-04
Posts: 88

Re: rsync over sftp?

I read the manpage:

--port=PORT
              This specifies an alternate TCP port number to use rather  than
              the  default  of 873.  This is only needed if you are using the
              double-colon (::) syntax to connect with an rsync daemon (since
              the  URL  syntax has a way to specify the port as a part of the
              URL).

Offline

#6 2010-01-10 13:57:09

theDOC
Member
From: Aachen, Germany
Registered: 2009-06-18
Posts: 50

Re: rsync over sftp?

my bad ... try:

rsync -a --rsh='ssh -p2222' user@host:/src/dir /dst/dir

Offline

Board footer

Powered by FluxBB