Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

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

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

 
discard

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.