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.
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.
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.
This is now in Portage as flexbackup-1.2.1-r5 with the help of the Gentoo Sunrise team. Thanks, genstef!
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?
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
I should mention that the above works only with flexbackup-1.2.1-r5 or later. - John