Take the 2-minute tour ×

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 user36@ rsync -az --delete 
--rsh='ssh -p2122 -qt' 
/home/user36/public_html/ user36@

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

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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

ssh -qt -p2123 user36@ "rsync -az --delete 
--rsh='ssh -p2122 -qt' 
/home/user36/public_html/ user36@"

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

share|improve this answer
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 '11 at 6:44
Not sure. I'm surprised that it ever worked. –  Cakemox Apr 9 '11 at 7:52
@gAMBOOKa: Just a shoot in the dark: Did you changed the locale settings on either your source machine or the server? –  desasteralex Apr 9 '11 at 17:20
@desasteralex: nope –  gAMBOOKa Apr 10 '11 at 10:28

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

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

share|improve this answer
-oPort is not an option for the version of ssh I'm using –  gAMBOOKa Apr 9 '11 at 6:30

Your Answer


