Bacula-users

Re: [Bacula-users] RunBeforeJob in background

2008-11-11 12:48:06
Subject: Re: [Bacula-users] RunBeforeJob in background
From: Ronald Buder <rbuder AT proficom-ag DOT de>
To: Arno Lehmann <al AT its-lehmann DOT de>
Date: Tue, 11 Nov 2008 11:34:21 +0100
Arno Lehmann wrote:
> Hi,
>
> 06.11.2008 11:32, Isabel Bermejo wrote:
>   
>> Hi all,
>>
>> I'm trying to backup a MySQL database and in the Job Resource I define the
>> command RunBeforeJob with a script that dumps the database to a fifo file. I
>> need to run both at the same time, I mean I want to run the script while
>> bacula runs the job. With RunBeforeJob, first dumps the database and then
>> starts the backup of a file. Does anyone know how to run a script in
>> background using RunBeforeJob to perform the dump and the backup job run at
>> the same time?
>>     
>
> The solution to that is to start the MySQL dump in the background. In 
> your run before job script, you'd create (or make sure it's useable) 
> the FIFO, then start mysqldump with an "&" at the end of the command 
> line. That sends the mysqldump to the background - you'll probably 
> need to detach from stdin, stdout and stderr first as these file 
> handles, when kept open, can prevent Bacula from going further.
>
> I believe I pointed you to a wiki page where a collection of sample 
> scripts is presented which backs up PostgreSQL in that fashion - 
> adapting those to MySQL should be possible without changing the stuff 
> around the actual database interface.
>
> Arno
>
>   
>> Thank you
>> ISABEL
>>     
The "&" is one way of doing it. I suspect a careful "nohup" would do 
just the same. For some instances I even use screen to work around 
parallel processes, not only for Bacula issues.

You _could_ even start a second job, an admin job for instance that 
takes care of the dumping.

A carefully placed "echo \"run job=\"TheJobName\" yes | bconsole\"" will 
work wonders.

Hope that helps,

regards...

-- 
Mit freundlichen Grüßen

Ronald Buder
Dipl-Ing.(BA)

Profi.Com AG
Büro Dresden
Stresemannplatz 3
D-01309 Dresden mail: rbuder AT proficom-ag DOT 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

<Prev in Thread] Current Thread [Next in Thread>