Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

On Mac os 10.9 I see:

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

rsync error: syntax or usage error (code 1) at /SourceCache/rsync/rsync-42/rsync/main.c(1385) [receiver=2.6.9]

hotel:~ tom$ rsync --daemon --help rsync version 2.6.9 protocol version 29 Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others. Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, inplace, IPv6, 64-bit system inums, 64-bit internal inums

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.