Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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'm trying to run rsync on Windows with the cwrsync port.

I'm issuing the following command (note that this is just a dry run):

rsync -nPaAz foouser@webxx.example.com:/home/foobar/webapps/barbaz/ C:\\mybackupfolder\

but I get the following error

The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1148) [Receiver=3.0.8]

Could someone point me in the right direction?

share|improve this question

For the destination try using:

/cygdrive/c/mybackupfolder/

Note that a colon tells rsync that the location is remote.

share|improve this answer
    
Gotcha about the colon! But it doesn't seem to help. Tried this other version (%CD% is an env variable pointing to the current dir) too but still failing: rsync -nPaAz foouser@webxx.example.com:/home/foobar/webapps/barbaz/ %CD% – Lorenzo Sep 20 '11 at 22:38
2  
what about changing to the destination directory and then just use "." for the destination? – jftuga Sep 21 '11 at 2:30

Got here from a similar problem with rsync for Windows.

Instead of using the path, just make a .bat file that uses CD C:\whereto\ then in the rsync command just use . as the directory to save to.

Example (something.bat):

@echo off  
cd C:\mybackupfolder\  
rsync -nPaAz foouser@webxx.example.com:/home/foobar/webapps/barbaz/ .  
share|improve this answer

Try

 rsync -nPaAz foouser@webxx.example.com:/home/foobar/webapps/barbaz/ C:/mybackupfolder/
share|improve this answer
    
This does not work as expected for me. – Emre Yazici Apr 29 '12 at 22:54

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.