Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 178126 - app-backup/flexbackup subtle subtree pruning issue / other small issues
Summary: app-backup/flexbackup subtle subtree pruning issue / other small issues
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-11 23:54 UTC by John R. Graham
Modified: 2007-07-27 20:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to address reported issues. (flexbackup-1.2.1-prune.patch,5.41 KB, patch)
2007-05-12 02:30 UTC, John R. Graham
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John R. Graham gentoo-dev 2007-05-11 23:54:36 UTC
When you specify a list of directories to prune, flexbackup gets it almost right.  It backs up all of the directories on the pruning list but none of the contents of those directories.  As such, little space is wasted in the backup and it's more if a nit than a real show stopper.

Here's even more of a nit.  The manpage incorrectly documents the "-extract -onefile" option, although it's correctly documented in the built-in help.

I'll be posting a patch shortly that corrects both issues and adds a little more documentation on the subtleties of the pruning mechanism.
Comment 1 John R. Graham gentoo-dev 2007-05-12 00:50:18 UTC
The issue was that flexbackup was taking the list of directories, for instance, like this one:

    $prune{'/home'} = "bert ernie bigbird";

from its conf file and constructing a regular expression (that's passed on the command line of "find") like this (necessary shell escaping omitted for clarity):

    -regex "\./(bert|ernie|bigbird)/.*" -prune

The "/.*" on the end of the regular expression ensured that any file under the listed directories would match and be pruned but, because of the trailing slash, the directory itself *would not* be matched.  The solution was to omit the last two atoms of the regular expression, resulting in:

    -regex "\./(bert|ernie|bigbird)" -prune

This results in each directory itself being pruned (which is what was wanted all along).  Since each directory is pruned, there's no need to match their contents.
Comment 2 John R. Graham gentoo-dev 2007-05-12 02:30:08 UTC
Created attachment 118958 [details, diff]
Patch to address reported issues.

* Fix the regex construction issue to correct subtree pruning.
* Minor code cosmetics (couldn't resist).
* Corrected a few typos in the flexbackup man page.
* Minor updates to the flexbackup.conf man page.
* Additional tutorial explanation and examples in the sample
  flexbackup.conf file.
Comment 3 John R. Graham gentoo-dev 2007-05-12 09:13:39 UTC
This is now in Portage as flexbackup-1.2.1-r5 with the help of the Gentoo Sunrise team.  Thanks, genstef!
Comment 4 Ivan Yarych 2007-07-24 12:45:07 UTC
I liked the old (current) behaviour of the prunning functionality. When you perform the estract you get dirs like /mnt/win_c, /usr/portage, /var/log created and have less problems after restoring the system, don't you think?
Comment 5 John R. Graham gentoo-dev 2007-07-24 17:21:05 UTC
Not really.  If you prune a directory, I think the most intuitive behavior is for it to *not* be included in the backup.  If you want to to back up the directory but not the contents, your prune term can still do this.  Just do

    some_path/.*

instead of

    some_path

Hope this helps.

- John
Comment 6 John R. Graham gentoo-dev 2007-07-27 20:33:25 UTC
I should mention that the above works only with flexbackup-1.2.1-r5 or later.

- John