User Tools

Site Tools


hints_tips:scheduling_vacation_holidays

Scheduling Vacation / Holidays

A holiday can present a scheduling problem when nobody is present to operate a tape drive. This topic has been discussed several times in the mailing list and is covered in various parts of the documentation. Many hints are supplied, but there is no definite solution.

Links:

The later I have worked out below.

An other way is to follow the steps in http://www.georglutz.de/wiki/Bacula ,but I do not recommend doing so. Although the idea of a generated PDF doc is a nice thing of course!

In bacula-dir.conf within a Job definition:

  # Am I allowed to be running at all today?
  RunBeforeJob = /usr/local/sbin/check_vacation.sh

External script:

#!/bin/sh
#
# v0.1 OZ
#
# use at your own risk
#
# parsed txt file with dates that are considered
# required date format: YYYY-MM-DD for example: 2008-10-23
# expecting 1 date per line
#
# if found: exit 0
# if not found: exit 1
#
HOL_FILE="/usr/local/etc/holidays.txt"
CUR_DATE=`date +%F`

#MY_DATE=$1
MY_DATE=$CUR_DATE

if [ -z `cat $HOL_FILE | grep ^$MY_DATE` ]; then
{
  echo "Date is not a known vacation day.";
}
else
{
  echo "Date is recognized as a known vacation day.";
}
fi

if [ ! -z `cat $HOL_FILE | grep ^$MY_DATE` ]; then exit 1;fi;

With datafile:

# tekstfile waarin vakantiedagen worden gedefineerd
# wordt gebruikt door de backup software
#
# format per regel: YYYY-MM-DD dus bijvoorbeeld: 2008-10-23

# 1e kerstdag
2008-12-25
2009-12-25
2010-12-25
2011-12-25
2012-12-25
2013-12-25
2014-12-25
2015-12-25

# 2e kerstdag
2008-12-26
2009-12-26
2010-12-26
2011-12-26
2012-12-26
2013-12-26
2014-12-26
2015-12-26

# oudjaarsdag
2008-12-31
2009-12-31
2010-12-31
2011-12-31
2012-12-31
2013-12-31
2014-12-31
2015-12-31

# nieuwjaarsdag
2008-01-01
2009-01-01
2010-01-01
2011-01-01
2012-01-01
2013-01-01
2014-01-01
2015-01-01

hints_tips/scheduling_vacation_holidays.txt · Last modified: 2010/04/16 11:43 by olaf