Super User is a question and answer site for computer enthusiasts and power users. 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'm trying to use rsync to backup data from a local shared drive to a remove server. Both the local machine and the remote server are running Cygwin under Windows XP. I use the following command:

rsync -aze ssh --size-only --delete //SharedFolder/dir/subdir user@remoteserver:/cygdrive/c/dir

The problem is that instead of copying files to the subdir directory, a new directory is created called subdir?, where ? is a non-ascii character. I tried various combinations of / at the end of the destination or remote path, always with the same result.

How can I tell rsync not to create this weird new directory?

share|improve this question
What's the ? character? echo subdir* | od -t x1 should reveal this. I suspect a stray CR (\x0d), but I don't know what would be causing that. – Gilles Nov 24 '11 at 21:06
up vote 2 down vote accepted

The problem was that the script file used to run the command was saved in the Windows format with \r\n line separators. That weird character was the carriage return. I saved the file in the unix format with just \n and things are now fine.

share|improve this answer

You must log in to answer this question.

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