Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to do rsync between two directories I have in two filesystems connected to the same computer. I want to do it without deleting the extra files in b. I though a simple rsync -a a/dir b/dir would work, but it doesn't seem to. This is on a Linux system with rsync version 3.0.6 protocol version 30:

$ mkdir -p a/test
$ mkdir -p b/test
$ touch a/test/file1
$ touch a/test/file2
$ touch b/test/file3
$ tree a/test b/test
a/test
├── file1
└── file2
b/test
└── file3

0 directories, 3 files
$ rsync -a a/test/ b/
$ tree a/test b/test
a/test
├── file1
└── file2
b/test
└── file3

0 directories, 3 files

The same command does work when I use it on a different Linux system with a slightly newer version of rsync (rsync version 3.0.9 protocol version 30). Any ideas what am I missing?

share|improve this question
    
looking at your posting "rsync -a a/test b/test" appears to do simply nothing at all, is that right? Is this a cut&paste error? I don't know the 'tree' cmd but at least both 'tree's show the same result. –  sparkie Jan 31 '13 at 11:59
add comment

1 Answer

up vote 1 down vote accepted

Answering my own question, it seems like the problem is with the slash at the end of the SRC dir:

rsync -a a/test/ b/

vs

rsync -a a/test  b/
share|improve this answer
add comment

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.