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

Mark Casey markc at unifiedgroup.com
Mon Mar 11 16:16:40 MDT 2013


On 3/11/2013 4:18 PM, Mark Casey wrote:
> 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
>

I was wrong. The command I listed is working after all, I just wasn't 
evaluating the results correctly. Sorry for the extra noise.

Thank you,
Mark



More information about the rsync mailing list