[rear-devel] RFC: Have BACKUP_PROG_OPTIONS --anchored by default?

Gratien D'haese gratien.dhaese at it3.be
Tue Oct 14 10:05:37 CEST 2014


 I think it makes sense - please copy/paste this request into an issue 
 Then we can act on it (and it is tracked, so we know why we did it 


 On Wed, 8 Oct 2014 16:54:08 +0200 (CEST), Johannes Meixner 
 <jsmeix at suse.de> wrote:
> Hello,
> when e.g. EXCLUDE_RECREATE contains something like "fs:/tmp" then
> /usr/share/rear/layout/prepare/default/61_exclude_from_restore.sh
> generates during "rear recover" the tar exclude patterns
> 'tmp' and 'tmp/*' (in /tmp/rear.*/tmp/restore-exclude-list.txt).
> Because how tar pattern matching works in particular the 'tmp'
> exclude pattern result that any files that contain '/tmp'
> in their path get excluded from restore, for example files
> (and directories) like /usr/tmp or /var/spool/cups/tmp
> and so on.
> The 'tmp' above is only an example. The issue happens for all
> short values that become autogenerated tar exclude patterns.
> Therefore - to be by default more on the safe side - I think
> it would make sense to have BACKUP_PROG_OPTIONS="--anchored"
> in /usr/share/rear/conf/default.conf
> I think if a user really wants it, he can use '*tmp*' to exclude
> all files that have 'tmp' somewhere in their path.
> By the way:
> I wonder why two tar exclude patterns 'tmp' and 'tmp/*' are 
> generated.
> As far as I tested it, 'tmp' excludes a superset of 'tmp/*'
> so that it seems 'tmp/*' is superfluous.
> FYI, see
> http://www.gnu.org/software/tar/manual/html_section/tar_50.html
> how tar pattern matching works, in particular it reads:
> --------------------------------------------------------------------
> If anchored, a pattern must match an initial subsequence of the
> name's components. Otherwise, the pattern can match any subsequence.
> Default is `--no-anchored' for exclusion members
> and `--anchored' inclusion members.
> --------------------------------------------------------------------
> and perhaps even more obviously "man 1 tar" reads:
> --------------------------------------------------------------------
>   --anchored
>       patterns match file name start
> ...
>   --no-anchored
>       patterns match after any `/' (default for exclusion)
> --------------------------------------------------------------------
> Kind Regards
> Johannes Meixner

 Gratien D'haese
 IT3 Consultants bvba
 Vennestraat 15, B-2560 Nijlen

More information about the rear-devel mailing list