Bacula-users

Re: [Bacula-users] multiple mtx-changer scripts

2008-07-22 03:15:06
Subject: Re: [Bacula-users] multiple mtx-changer scripts
From: Arno Lehmann <al AT its-lehmann DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 22 Jul 2008 09:14:51 +0200
Hi,

22.07.2008 05:04, Henry Yen wrote:
> perhaps looking up the parent processid.  in bash, it's a preset variable
> called "$PPID"; from there, look up the parent's process name.

That won't work, because mtx-changer is not executed by bconsole.

bconsole passes its commands to the DIR, the DIR interprets them, 
decides what to do, and - in this case - passes some commands to the SD.

It's probably possible to do what Mark wants in the SD; the SD 
probably knows if the changer stuff it's working on was triggered by 
itself running a job, or is unrelated to any SD activity.

I guess this is a bit complicated and requires a good understanding of 
the Bacula code (in which case you wouldn't have asked the initial 
question ;-)

Anyway, what I would do is a bit different.

In case of problems you're already working interactively.

Now, issuing mtx and btape commands is probably easily possible.

So I suggest to simply unmount from bconsole, do your necessary work 
(you could call a modified mtx-changer script from the shell), and 
when you're done, you remont from bconsole.

Much less work to implement such a procedure :-)

Arno

> On Mon, Jul 21, 2008 at 17:25:03PM -0700, Mark Nienberg wrote:
>> I'd like to be able to use a different version of the mtx-changer script 
>> when I use 
>> bconsole than the one I assigned to the "Changer Command" in bacula-sd.conf. 
>>  I guess 
>> I can script a wrapper for bconsole to rename the mtx-changer scripts as 
>> needed and 
>> then change them back afterward.  Or I could write a script to run before 
>> and after 
>> scheduled jobs to do the same thing.  But if anyone has a better idea I'd 
>> like to 
>> hear it.  Ideal solution would be if the mtx-changer script could recognize 
>> if it is 
>> being called from bconsole vs a bacula backup or restore job.
>>
>> Thanks,
>>
>> Mark
>>
>> P.S. Why?  Because I have modified the "load" command to use "btape" to read 
>> the 
>> bacula label on the volume after loading it.  If it fails, then it unloads 
>> and 
>> reloads the tape and tries again. This is an attempt to automatically fix 
>> the I/O 
>> problem that happens about 10-20% of the times bacula changes a tape in the 
>> middle of 
>> a backup.  Note that it is not a timing problem.  It happens even after 
>> "wait_for_drive" returns ready.  Obviously, when working at bconsole, there 
>> are some 
>> commands that I have to perform on tapes that have no labels, so I need a 
>> different 
>> "load" command.  But don't get bogged down thinking about all this, just 
>> think about 
>> the question above, OK?
> 

-- 
Arno Lehmann
IT-Service Lehmann
www.its-lehmann.de

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users