[Bacula-users] Calling client script ( Before / After jobs ) with parameters

2007-10-23 Thread David Ballester
Hi to all:

I'm currently working on the integration with bacula and rman, the
tool to make backups/restores of Oracle databases.


Reading bacula documentation, seems that some releases before, the
admin was able to define environment variables inside bacula  ( and
use them as parameters for the scripts called on before/after jobs )
but now this method seems deprecated in favor of python scripting.


My idea is to make standard scripts ( less maintenance and advantages
on adding new databases to backup ) that 'point to' the
database/catalog to backup using parameters, like this example:

/home/oracle/bin/full_backup_rman10g.sh   

Then should be called in bacula like this:

Client Run Before Job="/home/oracle/bin/full_backup_rman.sh
sys/[EMAIL PROTECTED] ORCL NOARCHIVELOG"

With this approach we could be able to deploy a set of identical
scripts ( no internal modification for each host with Oracle to be
protected and of course, no changes lost if we need to upgrade this
scripts) in the same way even if we use rman locally in the host with
the oracle database ( or databases ) to back up or if we use the same
machine where bacula-dir relays or if we use a third machine to
consolidate all rman procedures, etc...

I'm a completely python ignorant, and before spend time trying to
understand how to translate this behavior to python way of life, I
prefer ear from you.


Thanks in advance

D.

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Calling client script ( Before / After jobs ) with parameters

2007-10-23 Thread Arno Lehmann
Hello,

23.10.2007 16:03,, David Ballester wrote::
> Hi to all:
> 
> I'm currently working on the integration with bacula and rman, the
> tool to make backups/restores of Oracle databases.

Good idea.

> Reading bacula documentation, seems that some releases before, the
> admin was able to define environment variables inside bacula  ( and
> use them as parameters for the scripts called on before/after jobs )

I never noticed that, but I never looked for that, too.

> but now this method seems deprecated in favor of python scripting.

Using python, it should be possible to access the environment as well. 
Again, I haven't tried it yet, so I don't know if Bacula sets up the 
environment it inherits when started.

> 
> My idea is to make standard scripts ( less maintenance and advantages
> on adding new databases to backup ) that 'point to' the
> database/catalog to backup using parameters, like this example:
> 
> /home/oracle/bin/full_backup_rman10g.sh  chain>  
> 
> Then should be called in bacula like this:
> 
> Client Run Before Job="/home/oracle/bin/full_backup_rman.sh
> sys/[EMAIL PROTECTED] ORCL NOARCHIVELOG"
> 
> With this approach we could be able to deploy a set of identical
> scripts ( no internal modification for each host with Oracle to be
> protected and of course, no changes lost if we need to upgrade this
> scripts) in the same way even if we use rman locally in the host with
> the oracle database ( or databases ) to back up or if we use the same
> machine where bacula-dir relays or if we use a third machine to
> consolidate all rman procedures, etc...
> 
> I'm a completely python ignorant, and before spend time trying to
> understand how to translate this behavior to python way of life, I
> prefer ear from you.

You won't get my ear :-)

The rest of your approach seems reasonable and should be easily 
implemented. I found python was easy to learn and use, so for me it 
was definitely worth the effort.

Of course, using bash or whatever shell you prefer can be done, too. I 
think it's more or less a question of what you prefer.

If you start working on it, and expect to spend some time on this 
anyway, I'd suggest to pipe the rman output to Bacula directly, 
without the need of a dump file in between. That saves you a bit of 
disk space on the client.

The necessary parts are all available - you can backup from and 
restore to a FIFO in Bacula, and you can call scripts to set up the 
pipes and reader/writer processes. There are examples available, I'd 
start reading at wiki.bacula.org if I were you.

Of course, whatever you come up with might be worth adding to the 
wiki, too.

Arno

> Thanks in advance
> 
> D.
> 
> -
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
> 

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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Calling client script ( Before / After jobs ) with parameters

2007-10-24 Thread [EMAIL PROTECTED]
El mar, 23-10-2007 a las 20:35 +0200, Arno Lehmann escribió:
> Hello,
> 

> > 
> > I'm a completely python ignorant, and before spend time trying to
> > understand how to translate this behavior to python way of life, I
> > prefer ear from you.
> 
> You won't get my ear :-)
> 

Ahem... ok, may be I prefer listen :P

The abstract idea is to define the rman variables informed in the client
definitions and using the same job definition for standard backup
procedures

> The rest of your approach seems reasonable and should be easily 
> implemented. I found python was easy to learn and use, so for me it 
> was definitely worth the effort.
> 
> Of course, using bash or whatever shell you prefer can be done, too. I 
> think it's more or less a question of what you prefer.
> 
> If you start working on it, and expect to spend some time on this 
> anyway, I'd suggest to pipe the rman output to Bacula directly, 
> without the need of a dump file in between. That saves you a bit of 
> disk space on the client.
> 


That's very interesting, I will investigate how rman works with fifos,
but afaik, fifo has a maximum throughput of 8K/s, it's correct?


> The necessary parts are all available - you can backup from and 
> restore to a FIFO in Bacula, and you can call scripts to set up the 
> pipes and reader/writer processes. There are examples available, I'd 
> start reading at wiki.bacula.org if I were you.
> 

I will take a look to see if fifo approach fits well in bacula/rman
integration.

> Of course, whatever you come up with might be worth adding to the 
> wiki, too.
> 
> Arno
> 

Thanks again

D.


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Calling client script ( Before / After jobs ) with parameters

2007-10-24 Thread Arno Lehmann
Hi,

24.10.2007 10:44,, [EMAIL PROTECTED] wrote::
> El mar, 23-10-2007 a las 20:35 +0200, Arno Lehmann escribió:
>> Hello,
>>
> 
>>> I'm a completely python ignorant, and before spend time trying to
>>> understand how to translate this behavior to python way of life, I
>>> prefer ear from you.
>> You won't get my ear :-)
>>
> 
> Ahem... ok, may be I prefer listen :P
 >
> The abstract idea is to define the rman variables informed in the client
> definitions and using the same job definition for standard backup
> procedures

Yeah... well, passing the parameters through the command definition in 
the job should work. Getting them from outside of Bacula might be more 
complicated, but you'd have to try that...


>> The rest of your approach seems reasonable and should be easily 
>> implemented. I found python was easy to learn and use, so for me it 
>> was definitely worth the effort.
>>
>> Of course, using bash or whatever shell you prefer can be done, too. I 
>> think it's more or less a question of what you prefer.
>>
>> If you start working on it, and expect to spend some time on this 
>> anyway, I'd suggest to pipe the rman output to Bacula directly, 
>> without the need of a dump file in between. That saves you a bit of 
>> disk space on the client.
>>
> 
> 
> That's very interesting, I will investigate how rman works with fifos,
> but afaik, fifo has a maximum throughput of 8K/s, it's correct?

Not per se... see here:

neuelf:/tmp # mkfifo testfifo
neuelf:/tmp # cat testfifo > /dev/null &
[1] 22889
neuelf:/tmp # dd if=/dev/zero bs=4096 of=testfifo count=2M
2097152+0 records in
2097152+0 records out
8589934592 bytes (8.6 GB) copied, 17.5983 s, 488 MB/s
[1]+  Donecat testfifo > /dev/null

A bit better than 8k/second, I'd say.

This is on a dual-core Opteron running a 2.6.22.5 linux kernel, by the 
way. The machine is practically idle all the time.

> 
>> The necessary parts are all available - you can backup from and 
>> restore to a FIFO in Bacula, and you can call scripts to set up the 
>> pipes and reader/writer processes. There are examples available, I'd 
>> start reading at wiki.bacula.org if I were you.
>>
> 
> I will take a look to see if fifo approach fits well in bacula/rman
> integration.

As far as I know, it should. Not being an Oracle user, I don't have 
the personal experience, though.

Arno

>> Of course, whatever you come up with might be worth adding to the 
>> wiki, too.
>>
>> Arno
>>
> 
> Thanks again
> 
> D.
> 
> 

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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users