-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I currently maintain a number of small bacula installations for
organizations that only use a single tape drive and do full backups
every week night.  One issue that cause some grief is holidays - there
is no one around to change the tape and the situation is not handled as
elegantly as I would like.

I did some research and stumbled upon the following python script that
does exactly what I want: the script checks a text file with a simple
holiday schedule entered in a month/day format and will return 0 or 1
upon execution.

http://www.biostat.wisc.edu/~annis/creations/period.py.html

I tried a simple RunBeforeJob with the script itself - after fudging the
holiday file to make today look like a holiday.  The script returned a 1
- - as it should - but the job continued running.  I thought that if a 0
is not returned from a script then the director would abort executing
the job - exactly what I want for my single tape drive environment.

Here is the relevant bits from my bacula-dir.conf:

Job {
  Name = "TESTER"
  Type = Backup
  RunBeforeJob = "/etc/bacula/period.py"
  Client = testlet-fd
  FileSet = "Full Set"
  Schedule = "WeeklyCycle"
  Storage = DDS-3
  Messages = Standard
  Pool = Default
  Write Bootstrap = "/var/bacula/NightlySave.bsr"
  Max Start Delay = 22h
}

and from the log:
06-Mar 09:51 testlet-dir: No prior Full backup Job record found.
06-Mar 09:51 testlet-dir: No prior or suitable Full backup found. Doing
FULL backup.
06-Mar 09:51 testlet-dir: RunBefore: 1
06-Mar 09:51 testlet-dir: Start Backup JobId 6,
Job=TESTER.2006-03-06_09.51.28
06-Mar 09:51 testlet-sd: Job TESTER.2006-03-06_09.51.28 waiting. Cannot
find any appendable volumes.
Please use the "label"  command to create a new Volume for:
    Storage:      "DDS-3" (/dev/nst0)
    Media type:   DDS-3
    Pool:         Default

The RunBefore returns a 1 - but the job progresses.

I am sure there is a much more elegant way to integrate this python
script into the new bacula python framework - but i am certainly not the
guy to try that ... :)

Any thoughts on the best way to do this is greatly appreciated.

Dave

- --
Dave Dmytriw
Principal, NetCetera Solutions Inc.
Calgary, AB
403-703-1399
[EMAIL PROTECTED]
http://www.netcetera-solutions.com
"It's about using NetWorks, Etc..."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEDHBwDcivrcMaKcIRAnr0AJ9ZbIB02T01XFPhw2L1vF7gTJb7hACbByjG
3GPxtKRMOk+YlbEZl4dkatY=
=LmaD
-----END PGP SIGNATURE-----



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to