I have two file servers in two locations. Currently both have the same data, which generally is unmodified (used for read only access).When the second server was set up (the one I'm sshing to) the data was copied over LAN and has since been moved geographically.

I'm trying to use rsync for the first time on the required directories. An example command;

sudo rsync -avz --ignore-existing -P --dry-run /media/Storage/OSs/ user@mydomain:/mnt/Storage/OSs/

I've tried using -c -t -u (Additionally went on the remote server and updated the timestamps to today) also but every time I execute a dry run it wants to copy everything!

Additionally the user is the same for both machines with the same UID.


After playing around a bit more, I've found that rsync does not like the whitespace in the subdirectory names; For instance if I use ' to escape local shell & \ to escape remote shell

sudo rsync -avz --ignore-existing -P '/media/Storage/OSs/Windows/Windows server 2011/' 'user@mydomain:/mnt/Storage/OSs/Windows/Windows\ server\ 2011/'

Then all is well, my theory is then that rsync does not like the subdirectories with whitespaces. I have thousands of subdirectories; the only solution I can think of is to write a small python/shell script to run each sub directory separately but is undesirable.

  • What messages do you get? Have you tried to sync something else, preferable small data set, to see if it works at all? – Anders Mar 9 '14 at 11:33
  • Hi, yes I've tried a smaller sub directory with only a few items. Rsync works fine for directories when it was the original populator(unlike the current situation). I don't receive any error messages, only the normal verbose output (items sent, then summary at the end) – Alex Mar 9 '14 at 12:19
  • Is rsync installed on both machines? Are the dates on both machines correct? – terdon Mar 9 '14 at 16:46
  • Yes Rsync is on both machines, The date is correct on both (although the remote machine is approx 1minute behind the local machine) – Alex Mar 9 '14 at 16:55
  • Hi Alex, whitespaces in the command (and thus in the backup directories) are problematic and the directory steps with whitespaces should be between '', but in subdirectories it should be no problem. it is the shell that does not like the whitespaces in the command. – Jacob Vlijm Mar 9 '14 at 18:43

Turns out I should have bitten the bullet... The dry run was just outputting the directories it explores but not the actual files.

I ran rsync for real and all was ok it skipped everything apart from the one or two new additions.

For reference this worked;

sudo rsync -avzs --ignore-existing --progress '/media/Storage/OSs/' 'User@MyDomain:/mnt/Storage/OSs/'

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.