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 have a huge number of small files to rsync to a Windows machine. Most of them transferred just fine, but every file with a colon couldn't be transferred because the filename is invalid on Windows.

Is there any practical hack-around that I could use to get those files regardless? For example, some rsync setting or some filename-escaping script that I could pipe rsync through?

share|improve this question
Where is it bombing out? On another Windows box or Linux box? Escaping reserved characters in a Windows shell is ^ IIRC and if you are using Linux, I believe it is `\\`. I could be wrong. – songei2f Feb 4 '11 at 14:12
@alha the errors occur on the Windows box, which is the destination of the copy. For the record, rsyncd is running on the remote, Unix box; Windows is running a cygwin-based rsync port. – romkyns Feb 4 '11 at 14:13
Well I am not sure then. Clearly the Windows shell/command prompt escape character will not help. You are probably looking for the \ character (I kept trying to put in a fscking code block, but it does not format properly. – songei2f Feb 4 '11 at 14:15
The character in the title of your question is called a "colon". This is a semicolon ;. – Dennis Williamson Feb 4 '11 at 15:33
@Dennis fixed, thanks. I know what it's called but inexplicably I keep writing "semicolon" when I mean "colon". – romkyns Feb 4 '11 at 15:35
up vote 2 down vote accepted

No, because the : is an invalid filename on Windows, rsync can't store it there since the OS will prevent it. You will have to rename those files.

share|improve this answer
OK, let's leave Windows out of this for the sake of argument. Is there no way for me to remove colons from filenames when rsyinc'ing from one unix box to another unix box? I'm certainly not an expert, but my overall impression is that Unix is really good at this sort of thing. – romkyns Feb 4 '11 at 14:51
Might want to look at this answer -… – dsolimano Feb 4 '11 at 15:09

You can install Windows Services for Unix/Subsystem for Unix-based Applications and run rsync on there, which will allow you to create files with : in them, or named CON, or whatever else you want. However, that may not be terribly useful, as you will only be able to access the files from other SUA applications, not regular Win32/Win64 apps. What are you trying to accomplish?

If you end up going this route, you should probably enable NTFS case sensitivity as well.

share|improve this answer
I need to process these files with certain tools on Windows. Rather than trying to figure out how to do the same thing on Unix, I thought I'd just copy the files. But then it turned out that some of them have colons in filenames. – romkyns Feb 4 '11 at 15:09

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.