Re: rsync protection filter for backed-up files
On Sat, 2008-11-01 at 14:43 -0700, Jacob Balazer wrote:[color=blue]
> I'm trying to have rsync keep backups of changed and deleted files.
> Following the examples in the man page, I've set the backup suffix and
> created a protection filter:
> --delete --backup --suffix=~`date +"%Y-%m-%d"` --filter='Pp *~????-??-??'
> But using this protection filter, not all of my backup files were
> protected from deletion. In each subesquent run of rsync, it would
> try to delete some of my backup files. The net effect was that the
> backed up files kept getting renamed with an ever longer string of
> appended suffixes.
> I changed the filter to read as follows
> --delete --backup --suffix=~`date +"%Y-%m-%d"` --filter='P *~????-??-??'
> and then it worked correctly. Is "Pp" filter option as shown in the
> rsync manual page under the description of --backup a mistake? Or am
> I misunderstanding something about the way the protection filter is
> supposed to work?[/color]
The point of the man page was that rsync automatically adds a filter to
protect your backup files, so you don't have to specify your own unless
you have other filters that might override the automatically added one.
The "p" modifier is undesirable for backup files (as you saw), and the
automatically added rule does not use this modifier; the presence of the
"p" in the man page is an inaccuracy which I will have fixed.
Your second command is correct, and so would be a command with no
explicit --filter at all. The first command is weird, but I can't
explain why it misbehaved, since I would expect files in extraneous
destination directories to bypass your filter but then be caught by the
automatically added filter. Does anyone see something I'm missing here?
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: [url]https://lists.samba.org/mailman/listinfo/rsync[/url]
Before posting, read: [url]http://www.catb.org/~esr/faqs/smart-questions.html[/url]