0

I run this command to replicate data from one server to another. It's been working for a quite a while. I have this setup as a cron job. Yesterday for some reason, it stopped working. I ran it manually and got this error:

ssh -qt -p2123 [email protected] rsync -az --delete 
--rsh='ssh -p2122 -qt' 
/home/user36/public_html/ [email protected]:/home/user36/public_html/

rsync: -p2122: unknown option
rsync error: syntax or usage error (code 1) at main.c(1231) [client=2.6.8]

Note that the full command is executed in a single line, but is shown here in multiple lines for better readability

Why did it suddenly stop working? And why is it throwing the error at the ssh port option?

EDIT: This is on CentOS

3 Answers 3

1

You'll need to add quotes around the command you pass via ssh:

ssh -qt -p2123 [email protected] "rsync -az --delete 
--rsh='ssh -p2122 -qt' 
/home/user36/public_html/ [email protected]:/home/user36/public_html/"

This will keep the single-quotes from getting stripped out before rsync runs on the remote host.

4
  • That works! But why would that requirements suddenly change? I checked /var/log/yum.log and there were no recent automatic updates applied.
    – gAMBOOKa
    Apr 9, 2011 at 6:44
  • Not sure. I'm surprised that it ever worked.
    – Cakemox
    Apr 9, 2011 at 7:52
  • @gAMBOOKa: Just a shoot in the dark: Did you changed the locale settings on either your source machine or the server? Apr 9, 2011 at 17:20
  • @desasteralex: nope
    – gAMBOOKa
    Apr 10, 2011 at 10:28
0

Possibly it's stopped working due to a package upgrade but this works on Ubuntu/Debian:

rsync -e 'ssh -c blowfish -oPort=2212 -ax'

1
  • -oPort is not an option for the version of ssh I'm using
    – gAMBOOKa
    Apr 9, 2011 at 6:30
0

-p should be the argument for port number I usually put a space after it. If you connect in on port 2123 to run an rsync archive update with deletes against another server this time via port 2122.

My only suggestion is to try with a space after the -p and remove the -qt so:

ssh -p 2123 [email protected] rsync -az --delete --rsh='ssh -p 2122 ' /home/user36/public_html/ [email protected]:/home/user36/public_html/

You could also try removing the -qt (-q for quiet and -t to Force pseudo-terminal allocation.) on one, or the other, or both commands. Ports 2123 and 2122 need to be open on the relevant firewalls if any.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .