4

I have a virtual ubuntu server running on my windows server. This server has 2 external hdd's attached, which are mounted in ubuntu.

Now I try to run rsync to sync a directory on my desktop and my windows server.

I do this as follows:

rsync -av --update christophe@begijnhof.no-ip.org:/home/seagate/Syncfolder/Pictures/ /syncs/pictures

The /syncs/pictures is a symlink to /cygdrive/c/../pictures. All these symlinks work correctly, and the remote directory exists too.

Now when I run that rsync command above it does this:

created directory /syncs/pictures\#015

This actually creates a directory named "pictures" in my /syncs/ folder. So not in the symlink. Next to the symlink:

$ ls
pictures pictures?

When I add a trailing slash to the destination:

rsync -av --update christophe@begijnhof.no-ip.org:/home/seagate/Syncfolder/Pictures/ /syncs/pictures/

It creates a directory named "#015" (the weird dot) inside my actual Pictures folder on my tower!

I think it has something to do with encoding?

I wrote all the bash scripts in notepad++ with encoding to ANSI.

1
  • I solved this by running dos2unix in Windows on all the script files. You can also do this in Linux. – Christophe De Troyer Aug 28 '13 at 11:41
2

The fundamental problem here - at least in my case - was that the file in question had the Windows convention of a CR+LF charater at the end of the script file, as opposed to the *nix convention of simply using LF only. To fix this, you need to change the script file itself so that it following *nix conventions. The answer above suggests a couple of good ways to do that. Some editors (e.g. Notepad++) have similar functionality built-in.

1

I solved this by running dos2unix in Windows on all the script files. You can also do this in Linux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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