Change ClientRunBeforeJob script based on scheduler

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Change ClientRunBeforeJob script based on scheduler

Carlo Filippetto
Hi all,

I have Bacula 7.2.0 installed on Fedora 23.
I need to change the beaviour of a ClientRunBeforeJob based on scheduler, this to create differential or full dump of a DB.
how I can do this?

I would like to make this feature trought bacula and not with a custom script.



Thank you


---
Carlo

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Change ClientRunBeforeJob script based on scheduler

Wanderlei Huttel
Hello Carlo

In Bacula communiy is not possible yet  (maybe in Enterprise version only)
Probably in the Schedule you have more than one Level for this job.
You could adapt you script for receive a parameter like "Level" from Job and in the script select the the Full or Incremental using the value of parameter passed
Example: 

Job {
  Name = "Backup_XXX"
  ...
  RunBeforeJob = "/etc/bacula/scripts/backup_database.sh %l"  # %l = Job Level
  ...
}

Best Regards

Wanderlei Hüttel

2017-05-24 5:40 GMT-03:00 Carlo Filippetto <[hidden email]>:
Hi all,

I have Bacula 7.2.0 installed on Fedora 23.
I need to change the beaviour of a ClientRunBeforeJob based on scheduler, this to create differential or full dump of a DB.
how I can do this?

I would like to make this feature trought bacula and not with a custom script.



Thank you


---
Carlo

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Change ClientRunBeforeJob script based on scheduler

Heitor Faria
Hello, Wanderlei,

You are right. But I still think having a e.g. "ClientRunBeforeJobDiff", is a benefical new feature, since you might need to use different pre-backup binaries or scripts. Sometimes is not that practical to change them.
Maybe we can take a look on the code and propose a patch.

Regards,

Enviado do meu Telefone LG

------ Mensagem original------
De: Wanderlei Huttel
Data: qua, 24 de mai de 2017 7:40 AM
Para: Carlo Filippetto;
Cc:bacula-users;
Assunto:Re: [Bacula-users] Change ClientRunBeforeJob script based onscheduler

Hello Carlo

In Bacula communiy is not possible yet  (maybe in Enterprise version only)
Probably in the Schedule you have more than one Level for this job.
You could adapt you script for receive a parameter like "Level" from Job and in the script select the the Full or Incremental using the value of parameter passed
Example: 

Job {
  Name = "Backup_XXX"
  ...
  RunBeforeJob = "/etc/bacula/scripts/backup_database.sh %l"  # %l = Job Level
  ...
}

Best Regards

Wanderlei Hüttel

2017-05-24 5:40 GMT-03:00 Carlo Filippetto <[hidden email]>:
Hi all,

I have Bacula 7.2.0 installed on Fedora 23.
I need to change the beaviour of a ClientRunBeforeJob based on scheduler, this to create differential or full dump of a DB.
how I can do this?

I would like to make this feature trought bacula and not with a custom script.



Thank you


---
Carlo

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Change ClientRunBeforeJob script based on scheduler

Dan Langille
On May 24, 2017, at 6:52 AM, Heitor Faria <[hidden email]> wrote:

Hello, Wanderlei,

You are right. But I still think having a e.g. "ClientRunBeforeJobDiff", is a benefical new feature, since you might need to use different pre-backup binaries or scripts. Sometimes is not that practical to change them.
Maybe we can take a look on the code and propose a patch.
I suggest that given Bacula can already pass the data to whatever script you use, do this in your scripting language of choice. Then invoke what whatever binary you wish.

Just because we can expand the code does not mean we should. A simple shell script, for example, accomplishes this.

-- 
Dan Langille - BSDCan / PGCon
[hidden email]


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Change ClientRunBeforeJob script based on scheduler

Carlo Filippetto
In reply to this post by Wanderlei Huttel
it works!!!
  ClientRunBeforeJob = "\"C:\\Program Files\\Bacula\\scripts\\test\\bck-sql.bat\" %l"


Thank you

2017-05-24 12:35 GMT+02:00 Wanderlei Huttel <[hidden email]>:
Hello Carlo

In Bacula communiy is not possible yet  (maybe in Enterprise version only)
Probably in the Schedule you have more than one Level for this job.
You could adapt you script for receive a parameter like "Level" from Job and in the script select the the Full or Incremental using the value of parameter passed
Example: 

Job {
  Name = "Backup_XXX"
  ...
  RunBeforeJob = "/etc/bacula/scripts/backup_database.sh %l"  # %l = Job Level
  ...
}

Best Regards

Wanderlei Hüttel

2017-05-24 5:40 GMT-03:00 Carlo Filippetto <[hidden email]>:
Hi all,

I have Bacula 7.2.0 installed on Fedora 23.
I need to change the beaviour of a ClientRunBeforeJob based on scheduler, this to create differential or full dump of a DB.
how I can do this?

I would like to make this feature trought bacula and not with a custom script.



Thank you


---
Carlo

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Change ClientRunBeforeJob script based on scheduler

Dan Langille
> On May 26, 2017, at 4:36 PM, Carlo Filippetto <[hidden email]> wrote:
>
> it works!!!
>   ClientRunBeforeJob = "\"C:\\Program Files\\Bacula\\scripts\\test\\bck-sql.bat\" %l"

Good!

This type of approach will give you much more flexibility than modifying the Bacula code.

Small tools. Working together.

--
Dan Langille - BSDCan / PGCon
[hidden email]


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Change ClientRunBeforeJob script based on scheduler

Heitor Faria
Hello, Dan,

> This type of approach will give you much more flexibility than modifying the
> Bacula code.

I really understand and respect your point of view, and I think the two ways of invoking the per level job scripts could exist, providing even more flexibility!

>>   ClientRunBeforeJob = "\"C:\\Program Files\\Bacula\\scripts\\test\\bck-sql.bat\"
>>   %l"

This "inception" of escaping characters is not exactly the easiest thing for Microsoft SysAdmins to understand, the same thing for shell scripting.
My proposal is more automated, error proof and less time-consuming. We know backup scripts might get complex, and manual labor is more expensive every day.

> --
> Dan Langille - BSDCan / PGCon
> [hidden email]

Regards,
--
===========================================================================
Heitor Medrado de Faria | Bacula do Brasil
• Não seja tarifado pelo tamanho dos seus backups, conheça o Bacula Enterprise: http://www.bacula.com.br/enterprise/ 
• Ministro treinamento e implementação in-company do Bacula Community: http://www.bacula.com.br/in-company/ 
(61) 98268-4220 | www.bacula.com.br
============================================================================
Indicamos também as capacitações complementares:
• Shell básico e Programação em Shell com Julio Neves.
• Zabbix com Adail Host.
============================================================================

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users