do not update dirtimes on --include='*/' --exclude='*'

Mark Casey markc at
Mon Mar 11 15:18:24 MDT 2013


I'm trying to do something that did not sound difficult, but no option I've
 tried seems to be working. I apologize in advance if I'm missing something 

I need to sync only directories from one tree to a similar, but older tree
 *without* updating the modtimes of directories that already exist in the
 destination. Or phrased the other way, I want to entirely skip transferring or
 updating directories that already exist in the destination, without regard to
 modtime. Right now I'm using something along the lines of:

rsync -nav --no-t --numeric-ids --relative --include='*/' --exclude='*' \
 /media/mnt/files /media/backups/mnt/

I've also tried messing with --checksum, --ignore-existing, and --size-only to
 get rsync to ignore modtimes but I think most of what I'm trying is intended to
 work on files and not dirs.

Any insights?

In case you want to know... The use case is that I'm trying to get rsnapshot to
 work with rsync --detect-renamed, and so need to pre-populate new directories
 to the destination to get partial dir to operate for the rename detection...

Since rsnapshot calls the preexec script and *then* rotates you end up adding
 the dirs to the previous snapshot too even though they did not exist when it
 was taken. I'm working on a specific method that would avoid this.


More information about the rsync mailing list