Re: Directory masks -- howto?

Denis Corbin <[email protected]>
Newsgroups gmane.comp.sysutils.backup.dar.general
Message-ID <[email protected]>
Johnathan Burchill wrote:
> Hi Denis,

Hi Johnathan,

> 
> My KDE gui frontend is almost ready for initial release. Masks are giving 
> me a problem though. This is the "-P" option to dar which I am trying to 
> implement in the gui.
> 
> Here is the synopsis:
> Suppose I want to exclude a directory which contains the backup archive 
> 
> exdir="/home/john/kdar/backups";
> 
> from an archive whose root is 
> 
> rootdir="/home/john/kdar/";
> 
> I construct the subtree mask:
> 
> et_mask subtree;
> 
> Then I construct an exclusion mask:
> 
> ou_mask exclus;
> 
> Then with the add_mask() method, 
> 
> exclus.add_mask(simple_mask(exdir));
> 
> And then add exclus to the subtree:
> 
> subtree.add_mask(not_mask(exclus));

this is correct. Dar command-line does exactly the same.

> 
> libdar then warns (from op_create) that the backup archive 
> is in one of the directories that will be backed up, and an infinite loop 
> might result!

Strange. This warning is issued only if
1 - you create an archive
*and*
2 - the filename mask dot exclude the first slice filename
*and*
3 - the directory where is saved the archive (sauv_root) is not excluded 
by the subtree filter (subtree).

1 is true
2 is true
for the warning not to appear 3 must thus be false.
this lead me to the question, which arguments do you give to the 
op_extract() call, in particular, the fs_root and sauv_root ?

dar also calls op_extract, and in the current situation would call 
something like this:

	op_extract("/home/john/kdar", "/home/john/kdar/backups",
	bool_mask(true), subtree, ....)

with subtree built as you did:
	ou_mask exclus;
	exclus.add_mask(simple_mask("/home/john/kdar/backups"));
	et_mask subtree;
	subtree.add_mask(not_mask(exclus));

(you could also replace "subtree" by "not_mask(exclus)" in the argument 
given to op_extract, it should do the same in this case.


> It works fine when I have two "-P" type arguments:
> exdir1="/home/john/kdar/backups"
> exdir2="/home/john/kdar/backups/*"
> exclus.add_mask(simple_mask(exdir1));
> exclus.add_mask(simple_mask(exdir2));

this should not be necessary.

> 
> The command line version of libdar does not require me to have both "-P" 
> arguments for the backup to be excluded, I just need "-P backups". How do 
> I make it as simple using libdar directly?

we will find out, but be sure that dar command line uses the same 
interface as kdar and no such trick is necessary to avoid the warning 
message.

> 
> Thanks,
> JB
> 
> P.S. some screenshots of KDar can be found at
> http://www.phys.ucalgary.ca/~burchill/KDAR/index.html

that seems very promising !!! I'm impatient to try it !  :-)))

> 
> 
> Any suggestions?




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.