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

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


Hello,

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 
obvious.

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...

https://lists.samba.org/archive/rsync/2009-November/024225.html

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.

TIA,
Mark



More information about the rsync mailing list