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'm new to rsync, but I've noticed that at the top of the "receiving incremental file list" is ./

Is rsync overwriting the destination's ./ directory? The timestamp of ./ in destination matches the source, so I assume it is, and I can't seem to prevent this using --exclude './' or --exclude '*/'

Code:

rsync -av user@host:/dir1/dir2/ /dir3/dir4/dir5/dir6

In pseudocode, I'm trying to rsync all the files inside dir2 on host into dir6 on the local machine.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

./ and ../ are OS shortcuts, created by default.

./ is just a shortcut to the current working directory, so it's timestamp will always match the timestamp of the directory you're looking at.

As you're using the archive flag, timestamps will be preserved, and thus match the source.

share|improve this answer

Can you post the exact command you're running? It would help to know what options you're specifying along with the source and destination directories. Sounds to me like you are confused with the source entry. You need to specify if you would like to sync the contents of the source directory or the entire directory itself. Per the manual documentation:

A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this direc‐ tory" as opposed to "copy the directory by name", but in both cases the attributes of the containing directory are transferred to the con‐ taining directory on the destination. In other words, each of the following commands copies the files in the same way, including their setting of the attributes of /dest/foo:

          rsync -av /src/foo /dest
          rsync -av /src/foo/ /dest/foo
share|improve this answer

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.