--compare-dest seems to nullify --update

Paul Gover pmw.gover at yahoo.co.uk
Sun Mar 28 17:50:00 UTC 2021

> I'm  using rsync to update my local database snapshot from a remote pooled
> mirror server. The trouble is that the servers in the pool are sometimes
> out of date, so I only want to update when the files are newer than the
> local copies to avoid unnecessary I/O..
> ...

I've found a workaround by using hard links.  Instead of:
	cp -r <current> <new>
	rsync --update, <mirror> <new>
	mv <new> <current>
I now:
	mkdir <new>
	ln -f <current>/* <new>
	rsync --update, <mirror> <new>
	if [ <new>.<stuff> -nt <current>.<stuff> ]
	then mv <current> <old> ; mv <new> <current>
	else rm -r <new>
Since the files in <new> are the same as in <current>, --update does its job properly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20210328/d5e14dff/attachment.htm>

More information about the rsync mailing list