Re: [Bacula-users] Bacula ClientRunBeforeJob

2009-10-28 Thread Arno Lehmann
Hi,

21.10.2009 08:42, Robert Backhaus wrote:
 Hello all,
 
 i want to backup mysql binlog files incremetally. We wrote a script
 (binlog-backup), which flush the logs and writes the backupfiles to 
 restore.info.
 
 config 
 
 ClientRunBeforeJob= /usr/local/bin/binlog-backup
  
 Include {
   Options { signature = SHA1 }
   File = \\/data/mysql-binlog/restore.info
 }
 
 /config
 
 Now i have the effect: the bacula job reads restore.info before running the
 script. the result is: i backup the files a job later. An additional cronjob 
 on
 the client, i want to avoid. Currently my approach is to schedule 2 jobs: 
 with 
 ClientRunBeforeJob to create the filelist and backup a zero directory and a
 second (5 min later )to backup the files from restore.info. 
 
 1) Is there a way to configure bacula, to do the Clientrunbeforjob and than 
 reads
 the filelist?

None that I know. Might be a nice feature request.

 2) Is there a way to pass paramtere/variables (files to backup)  to bacula

The way you do it is the right one, I think.

 3) Any other hints?

Yes... the way I do this sort of thing is to prepare the backup in a 
script that also lists the files to back up. Essentially the job 
preparation is moved from the Job resource to the FileSet one.

The file set is dynamically generated, not stored in a file, but the 
script just prints all the files that it prepared to stdout, and 
Bacula picks that up as its list of files to back up.

In the configuration, it looks a bit messy because you don't easily 
see that there is some work done before the backup can start, but it's 
working.

Cheers,

Arno

 Robert
 
 
 
 --
 Come build with us! The BlackBerry(R) Developer Conference in SF, CA
 is the only developer event you need to attend this year. Jumpstart your
 developing skills, take BlackBerry mobile applications to market and stay 
 ahead of the curve. Join us from November 9 - 12, 2009. Register now!
 http://p.sf.net/sfu/devconference
 ___
 Bacula-users mailing list
 Bacula-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bacula-users
 

-- 
Arno Lehmann
IT-Service Lehmann
Sandstr. 6, 49080 Osnabrück
www.its-lehmann.de

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Bacula ClientRunBeforeJob

2009-10-22 Thread Robert Backhaus
On Wed, Oct 21, 2009 at 10:44:01AM +0200, Christian Gaul wrote:
 Robert Backhaus schrieb:
  Hello all,
 
  i want to backup mysql binlog files incremetally. We wrote a script
  (binlog-backup), which flush the logs and writes the backupfiles to 
  restore.info.
 
  config 
 
  ClientRunBeforeJob= /usr/local/bin/binlog-backup
   
  Include {
Options { signature = SHA1 }
File = \\/data/mysql-binlog/restore.info
  }
 
  /config
 
  Now i have the effect: the bacula job reads restore.info before running the
  script. the result is: i backup the files a job later. An additional 
  cronjob on
  the client, i want to avoid. Currently my approach is to schedule 2 jobs: 
  with 
  ClientRunBeforeJob to create the filelist and backup a zero directory and a
  second (5 min later )to backup the files from restore.info. 
 
  1) Is there a way to configure bacula, to do the Clientrunbeforjob and than 
  reads
  the filelist?
 
  2) Is there a way to pass paramtere/variables (files to backup)  to bacula
 
  3) Any other hints?
 
  Robert

 the runbefore script should not be returning immediately, what happens
 if you run /usr/local/bin/binlog-backup manually? do you get right back
 to the shell or does it take a while to write the data to restore.info?

the scripts runs 1 second 
 
 if the job returns right away then there is nothing bacula can do, you
 have to fix your script to actually finish processing before returning
 (synchronous instead of asynchronous). For me bacula waits until the
 runbefore script(s) have finished before saving data.

if i understand you right, you have an anlaog szenario - your script writes 
a file and bacula include this file in one job and it works ... 

Robert


 
 --
 Come build with us! The BlackBerry(R) Developer Conference in SF, CA
 is the only developer event you need to attend this year. Jumpstart your
 developing skills, take BlackBerry mobile applications to market and stay 
 ahead of the curve. Join us from November 9 - 12, 2009. Register now!
 http://p.sf.net/sfu/devconference
 ___
 Bacula-users mailing list
 Bacula-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bacula-users

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Bacula ClientRunBeforeJob

2009-10-22 Thread Christian Gaul
Robert Backhaus schrieb:
 On Wed, Oct 21, 2009 at 10:44:01AM +0200, Christian Gaul wrote:
   
 Robert Backhaus schrieb:
 
 Hello all,

 i want to backup mysql binlog files incremetally. We wrote a script
 (binlog-backup), which flush the logs and writes the backupfiles to 
 restore.info.

 config 

 ClientRunBeforeJob= /usr/local/bin/binlog-backup
  
 Include {
   Options { signature = SHA1 }
   File = \\/data/mysql-binlog/restore.info
 }

 /config

 Now i have the effect: the bacula job reads restore.info before running the
 script. the result is: i backup the files a job later. An additional 
 cronjob on
 the client, i want to avoid. Currently my approach is to schedule 2 jobs: 
 with 
 ClientRunBeforeJob to create the filelist and backup a zero directory and a
 second (5 min later )to backup the files from restore.info. 

 1) Is there a way to configure bacula, to do the Clientrunbeforjob and than 
 reads
 the filelist?

 2) Is there a way to pass paramtere/variables (files to backup)  to bacula

 3) Any other hints?

 Robert
   
   
 the runbefore script should not be returning immediately, what happens
 if you run /usr/local/bin/binlog-backup manually? do you get right back
 to the shell or does it take a while to write the data to restore.info?
 

 the scripts runs 1 second 
   
which doesn't really help diagnose the problem :-)
is the file writing completed at the end of the script, or does it fork
into the background to do its work?
if it forks, change it.
  
   
 if the job returns right away then there is nothing bacula can do, you
 have to fix your script to actually finish processing before returning
 (synchronous instead of asynchronous). For me bacula waits until the
 runbefore script(s) have finished before saving data.
 

 if i understand you right, you have an anlaog szenario - your script writes 
 a file and bacula include this file in one job and it works ... 

 Robert

   
Yes. Simple example is mysqldump that writes the dump to a file.. you
can fork that into the background or you can wait for it to get done
writing, if you dont wait for it to finish writing bacula cant back it up.

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Bacula ClientRunBeforeJob

2009-10-21 Thread Christian Gaul
Robert Backhaus schrieb:
 Hello all,

 i want to backup mysql binlog files incremetally. We wrote a script
 (binlog-backup), which flush the logs and writes the backupfiles to 
 restore.info.

 config 

 ClientRunBeforeJob= /usr/local/bin/binlog-backup
  
 Include {
   Options { signature = SHA1 }
   File = \\/data/mysql-binlog/restore.info
 }

 /config

 Now i have the effect: the bacula job reads restore.info before running the
 script. the result is: i backup the files a job later. An additional cronjob 
 on
 the client, i want to avoid. Currently my approach is to schedule 2 jobs: 
 with 
 ClientRunBeforeJob to create the filelist and backup a zero directory and a
 second (5 min later )to backup the files from restore.info. 

 1) Is there a way to configure bacula, to do the Clientrunbeforjob and than 
 reads
 the filelist?

 2) Is there a way to pass paramtere/variables (files to backup)  to bacula

 3) Any other hints?

 Robert
   
the runbefore script should not be returning immediately, what happens
if you run /usr/local/bin/binlog-backup manually? do you get right back
to the shell or does it take a while to write the data to restore.info?

if the job returns right away then there is nothing bacula can do, you
have to fix your script to actually finish processing before returning
(synchronous instead of asynchronous). For me bacula waits until the
runbefore script(s) have finished before saving data.

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users