Bacula-users

Re: [Bacula-users] Backing up lvm snapshots? Worked around.

2011-09-20 15:29:01
Subject: Re: [Bacula-users] Backing up lvm snapshots? Worked around.
From: Tobias Schenk <tobias AT die-schenks DOT net>
Date: Tue, 20 Sep 2011 21:26:29 +0200
Am 20.09.2011 00:36, schrieb Konstantin Khomoutov:
> On Mon, Sep 19, 2011 at 10:15:02PM +0200, Tobias Schenk wrote:
>
>> thank you for the comments regarding readlink. Unfortunately, it
>> does not work :(
>> if I do:
>> bash>readlink /dev/vmguests/backup
>> I get:
>> ../dm-6
>>
>> I was suspicous about the relative path but this can be healed by adding -f:
>> bash>readlink -f /dev/vmguests/backup
>> /dev/vmguests/dm-6
>>
>> With this new weapon I changed the File = directive as described in
>> your mails: File = "| readlink /dev/vmguests/backup".
>> I open bconsole, do reload, do run, select job ... and get 89 bytes
>> backuped.
>> ( I tested also the -f variant)
>>
>> I cross checked by changing File= "/dev/dm-6". This saves 4.4GB of data.
>>
>> My guess is that the link does not yet exist when the Fileset is parsed.
>> How can I find out about this. Can I raise the log level to see the
>> parsed version of File= ?
> Let's quote the manual:
>
> "Any name beginning with a vertical bar () is assumed to be the name of
> a program. This program will be executed on the Director's machine at
> the time the Job starts (not when the Director reads the configuration
> file), and any output from that program will be assumed to be a list of
> files or directories, one per line, to be included."
>
> The "run before job" scripts are run before the job is considered to be
> started, so you have to make sure the snapshot device is created in that
> "run before job type" script.
>
Hello,

that is correct. But does not help my case. Because the file list to be 
backed up is obviously evaluated before the runscript is run.
If I run the script creating the lvm snapshot immediately before 
starting the job manually, then resolving the sym link using readlink works.
If I run the script from the Runscript directive it does not.

I work around by modifying my mount script so that it returns the target 
of the symlink and put it in the File directive.
This way the snapshot gets created at the time when the File directive 
is evaluated.
This works.
I call it a work around because there should be a RunsWhen option 
"RunsBeforeEverything" to do this properly.

Thank you all for your comments.

Best regards,
Tobias





------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users