Super User is a question and answer site for computer enthusiasts and power users. 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 directories and files locally and I want to copy them over to another box using rsync . The problem is that most of the data is already on the remove box, but not on the target disk. E.g., I have

local:~/$ ls -F
a/ b/ foo

and

remote:~/dest$ ls -F
a@

where remote:~/dest/a points to a directory which already contains most of local:~/a.

When I do

local$ rsync --append-verify --progress -auv * remote:~/dest/

symlink remote:~/dest/a is replaced with an empty directory where rsync starts copying data from local.

How do I accomplish the effect of

local$ rsync --append-verify --progress -auv foo remote:~/dest/
local$ rsync --append-verify --progress -auv a/* remote:~/dest/a/
local$ rsync --append-verify --progress -auv b remote:~/dest/

with a single rsync invocation?

share|improve this question
up vote 2 down vote accepted

From the rsync man page :

    -K, --keep-dirlinks         treat symlinked dir on receiver as dir
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .