rsync between two local directories

14

2

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?

719016

Posted 2013-01-31T11:20:24.837

Reputation: 2 899

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 – 2013-01-31T11:59:44.647

Answers

16

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/

719016

Posted 2013-01-31T11:20:24.837

Reputation: 2 899