Keeping File Trees in Sync

David E. Meier dev at
Fri Nov 12 11:13:39 GMT 2004

Hi list,

I try to keep a local file tree synchronized with the remote one. However,
using the --delete option does not work as expected or at least as I whish
it would. Here is an example of the local tree I'd like to sync:


On the remote machine I have:


Here is the rsync call I use:

Executing rsync with: -avvr --delete --temp-dir=temp -e "ssh -P -i
.ssh/identity -o StrictHostKeyChecking=no -o PasswordAuthentication=no"
--stats --exclude-from=files.exc /data

where the include file contains:


and the exlude file contains:


Syncing with the above example I would expect that the directory dirC
would get deleted on the remote machine, however, it does not. I assume
the --delete option only checks within the include paths specified. Is
this the expected behaviour of rsync and what could be a workaround to the

Thanks, Dave

More information about the rsync mailing list