--delete not working, fixed!

Sylvain Viart sylvain.viart at easyrencontre.com
Tue Sep 25 15:33:35 GMT 2007


Hi Matt,

In fact, reading bug 3825, has explained me the meaning of Hide and 
Protect filter rule. Which I couldn't really understand from the doc.

As I said, Protect and Hide, are not "really" documented. It's only said 
in the doc :

> *hide, H* specifies a pattern for hiding files from the transfer. 

It doesn't means for me, what you said in the bug 3825:

> Evidently you want some of your exclude patterns to behave as a hide only
> (temporary files) and others to behave as a hide plus a protect (other sections
> of the backup).  Either use --filter="H file.tmp" instead of
> --exclude=file.tmp, or use --delete-excluded and use --filter="P
> /other-backup-area" in addition to --exclude=/other-backup-area .
Now I'm able to do somewhat similar as said in the bug report:

If I add --filter='H .svn' svn working copy administrative folder are 
not only, not uploaded on the remote rsync destination, they are also 
removed if they were present. And that's what I wanted!


Now I do:

rsync -rtlv  --filter='P lib/conf/**'  \
                --filter='H src/**'  \
                --filter='H .svn' \
                --filter='H .*.sw[po]' --delete \
                  preprod/ rsync://remote/deploiement/preprod/

Which seems to work exactly as expected:

 * protect remote lib/conf/* file to be deleted if any (also upload 
local working copy file if any)
 * exclude and delete remotely any hidden file, (here: some src folder, 
.svn + subtree, vim swap file)


Thanks,
Sylvain.
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list