Discussion:
rsync over different ssh port
Ron McKown
2001-11-05 23:49:59 UTC
Permalink
hey folks,
rsync is a great tool! i use it mostly to sync up Documents between several
machines. i use it like this:
rsync --progress -vrae ssh /home/bill/Graphics/
***@vortex:/home/rmckown/Graphics/

the problem i have, is i want to specifiy a specific ssh port other than 22.
i want to connect to a specific ssh server behind the firewall on the remote
end.

it would be nice to use the command like this:
rsync --progress -vrae ssh -p8022 /home/bill/Graphics/
***@vortex:/home/bill/Graphics/

anyone have any ideas?

Ron McKown
***@envenergy.com
JD Paul
2001-11-06 00:23:12 UTC
Permalink
Make a script; call it 'sshp' for this example:

% cat sshp
#!/bin/sh
exec ssh -p 8022 "$*"

and then run

rsync -av -e sshp <source> <dest>

Such a wrapper script is useful for including other options (-x, -a,
-o 'BatchMode yes', etc.).

Cheers --

JD
+-------------------------------------+-------------------------------------+
| JD Paul | Do not meddle in the affairs of |
| ***@interstel.net | sysadmins, for they are not |
| http://www.interstel.net/~jdpaul/ | particularly subtle, and have |
| | the root password. |
+-------------------------------------+-------------------------------------+
Post by Ron McKown
hey folks,
rsync is a great tool! i use it mostly to sync up Documents between several
rsync --progress -vrae ssh /home/bill/Graphics/
the problem i have, is i want to specifiy a specific ssh port other than 22.
i want to connect to a specific ssh server behind the firewall on the remote
end.
rsync --progress -vrae ssh -p8022 /home/bill/Graphics/
anyone have any ideas?
Ron McKown
Tim Potter
2001-11-06 00:40:48 UTC
Permalink
Post by JD Paul
% cat sshp
#!/bin/sh
exec ssh -p 8022 "$*"
and then run
rsync -av -e sshp <source> <dest>
Such a wrapper script is useful for including other options (-x, -a,
-o 'BatchMode yes', etc.).
If you just want to use the -p option you can always do:

rsync -av -e 'ssh -p 8022' <source> <dest>

Of course the script option is better if you don't want to type it
in all the time.


Tim.
t***@philips.com
2001-11-06 15:33:17 UTC
Permalink
You're in luck. the argument to -e can be a quoted string.

rsync --progress -vrae 'ssh -p 8022' /home/bill/Graphics/
***@vortex:/home/bill/Graphics/
These hotshots thought of everything, didn't they?

Tim Conway
***@philips.com
303.682.4917
Philips Semiconductor - Longmont TC
1880 Industrial Circle, Suite D
Longmont, CO 80501
Available via SameTime Connect within Philips, n9hmg on AIM
perl -e 'print pack(nnnnnnnnnnnn,
19061,29556,8289,28271,29800,25970,8304,25970,27680,26721,25451,25970),
".\n" '
"There are some who call me.... Tim?"




Ron McKown <***@envenergy.com>
Sent by: rsync-***@lists.samba.org
11/05/2001 04:49 PM
Please respond to rmckown


To: ***@lists.samba.org
cc: (bcc: Tim Conway/LMT/SC/PHILIPS)
Subject: rsync over different ssh port
Classification:



hey folks,
rsync is a great tool! i use it mostly to sync up Documents between
several
machines. i use it like this:
rsync --progress -vrae ssh /home/bill/Graphics/
***@vortex:/home/rmckown/Graphics/

the problem i have, is i want to specifiy a specific ssh port other than
22.
i want to connect to a specific ssh server behind the firewall on the
remote
end.

it would be nice to use the command like this:
rsync --progress -vrae ssh -p8022 /home/bill/Graphics/
***@vortex:/home/bill/Graphics/

anyone have any ideas?

Ron McKown
***@envenergy.com
Roger Lipscombe
2001-11-06 17:14:06 UTC
Permalink
Post by t***@philips.com
You're in luck. the argument to -e can be a quoted string.
rsync --progress -vrae 'ssh -p 8022' /home/bill/Graphics/
These hotshots thought of everything, didn't they?
I've even used it like this (from memory):

rsync -auvz -e 'ssh outside rsh' /home/whatever/ inside:/home/wherever

To get around the fact that I didn't have a port-forward from 'outside' to
'inside', but did have working .rhosts.

Cheers,
Roger.

--
Roger Lipscombe
Software Developer, SONICblue Incorporated
Raj
2002-01-24 16:21:13 UTC
Permalink
Tim,
Currently I have rsync setup on hosta which syncs to
hostb. Rsync deletes whatever deleted from hosta and
copy and sync from hosta to hostb. Does rsync catch
changes made and sync hosta in case any changes are
made to hostb?

Please let me know.

Thanks
Raj


=====


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com
t***@philips.com
2002-01-24 20:55:40 UTC
Permalink
No. Rsync is unidirectional.
If you try to do it both ways, first, it's going to delete anything on
hostb that isn't on hosta, then make all the files on hostb just like
hosta. Then, if you try to go back the other way, all the changes on
hostb are already gone.
There is a product called "unison", which is made to do what you're asking
about. I don't know more about it than that it exists. A quick google
should get you to it.
Good luck.

Tim Conway
***@philips.com
303.682.4917
Philips Semiconductor - Longmont TC
1880 Industrial Circle, Suite D
Longmont, CO 80501
Available via SameTime Connect within Philips, n9hmg on AIM
perl -e 'print pack(nnnnnnnnnnnn,
19061,29556,8289,28271,29800,25970,8304,25970,27680,26721,25451,25970),
".\n" '
"There are some who call me.... Tim?"




Raj <***@yahoo.com>
01/24/2002 09:21 AM


To: Tim Conway/LMT/SC/***@AMEC
cc: ***@lists.samba.org
rsync-***@lists.samba.org
Subject: Rsync
Classification:




Tim,
Currently I have rsync setup on hosta which syncs to
hostb. Rsync deletes whatever deleted from hosta and
copy and sync from hosta to hostb. Does rsync catch
changes made and sync hosta in case any changes are
made to hostb?

Please let me know.

Thanks
Raj


=====


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com
Joseph Miller
2002-01-24 21:33:19 UTC
Permalink
http://www.cis.upenn.edu/~bcpierce/unison/
Post by t***@philips.com
No. Rsync is unidirectional.
If you try to do it both ways, first, it's going to delete anything on
hostb that isn't on hosta, then make all the files on hostb just like
hosta. Then, if you try to go back the other way, all the changes on
hostb are already gone.
There is a product called "unison", which is made to do what you're asking
about. I don't know more about it than that it exists. A quick google
should get you to it.
Good luck.
Continue reading on narkive:
Loading...