#
# Bacula Director Configuration file
#

###########
## DIRECTOR ##
###########


Director {
  Name =Bacula-dir
  DIRport = 9101
  QueryFile = "/etc/bacula/scripts/query.sql"
  WorkingDirectory = "/var/lib/bacula"
  PidDirectory = "/var/run/bacula"
  Maximum Concurrent Jobs = 1
  Password = ""         # Console password
  Messages = Daemon
}

########
## JOBS ##
########


JobDefs {

  Name = "CommonJob"
  Max Start Delay = 22h
  Storage = Tape
  Messages = Standard
  Type = Backup
  Level = Full
  FileSet = "Test Data Set"
}

Job {
  Name = "TestMondayBackup"
  Client = test-fd
  Schedule = "MondayEvening"
  Pool = MondayPool
  Write Bootstrap = "/var/lib/bacula/TestMondayBackup.bsr"
  JobDefs = CommonJob
}

Job {
  Name = "TestTuesdayBackup"
  Client = test-fd
  Schedule = "TuesdayEvening"
  Pool = TuesdayPool
  Write Bootstrap = "/var/lib/bacula/TestTuesdayBackup.bsr"
  JobDefs = CommonJob
}

Job {
  Name = "TestWednesdayBackup"
  Client = test-fd
  Schedule = "WednesdayEvening"
  Pool = WednesdayPool
  Write Bootstrap = "/var/lib/bacula/TestWednesdayBackup.bsr"
  JobDefs = CommonJob
}

Job {
  Name = "TestThursdayBackup"
  Client = test-fd
  Schedule = "ThursdayEvening"
  Pool = ThursdayPool
  Write Bootstrap = "/var/lib/bacula/TestThursdayBackup.bsr"
  JobDefs = CommonJob
}

Job {
  Name = "TestFridayBackup"
  Client = test-fd
  Schedule = "FridayEvening"
  Pool = FridayPool
  Write Bootstrap = "/var/lib/bacula/TestFridayBackup.bsr"
  JobDefs = CommonJob
}

Job {
  Name = "TestSaturdayBackup"
  Client = test-fd
  Schedule = "SaturdayEvening"
  Pool = SaturdayPool
  Write Bootstrap = "/var/lib/bacula/TestSaturdayBackup.bsr"
  JobDefs = CommonJob
}

Job {
  Name = "TestSundayBackup"
  Client = test-fd
  Schedule = "SundayEvening"
  Pool = SundayPool
  Write Bootstrap = "/var/lib/bacula/TestSundayBackup.bsr"
  JobDefs = CommonJob
}


# Standard Restore template, changed by Console program
Job {
  Name = "RestoreFiles"
  Type = Restore
  Client = test-fd
  FileSet = "Test Data Set"
  Storage = Tape
  Messages = Standard
  Pool = Default
  Where = /tmp/bacula-restores
}




###########
## FILESETS ##
###########


# List of files to be backed up
FileSet {
  Name = "Test Data Set"
  Include {
    Options { signature = SHA1 compression=GZIP }

    File = "c:\\data"

  }
}



#############
## SCHEDULES  ##
#############


Schedule {
  Name = "MondayEvening"
  Run = Full Monday at 10:00pm
}

Schedule {
  Name = "TuesdayEvening"
  Run = Full Tuesday at 10:00pm
}

Schedule {
  Name = "WednesdayEvening"
  Run = Full Wednesday at 10:00pm
}

Schedule {
  Name = "ThursdayEvening"
  Run = Full Thursday at 10:00pm
}

Schedule {
  Name = "FridayEvening"
  Run = Full Friday at 10:00pm
}

Schedule {
  Name = "SaturdayEvening"
  Run = Full Saturday at 10:00pm
}

Schedule {
  Name = "SundayEvening"
  Run = Full Sunday at 10:00pm
}



#############
##    CLIENTS     ##
#############


Client {
  Name = Bacula-fd
  Address = Bacula
  FDPort = 9102
  Catalog = MyCatalog
  Password = ""          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}

Client {
  Name = test-fd
  Address = 192.168.15.154
  FDPort = 9102
  Catalog = MyCatalog
  Password = "avenger"
  File retention = 30 days
  Job Retention = 6 months
  AutoPrune = yes
}


#############
##    STORAGE   ##
#############


# Definiton of file storage device
Storage {
  Name = File
  Address = 172.16.1.71
  SDPort = 9103
  Password = ""
  Device = FileStorage
  Media Type = File
}


Storage {
  Name = Tape
  Address = 172.16.1.71
  SDPort = 9103
  Password = ""
  Device = TapeStorage
  Media Type = LTO-2
}


#############
##   CATALOGS   ##
#############


Catalog {
  Name = MyCatalog
  dbname = bacula; DB Address = localhost; user = bacula; password = ""
}


#############
##   MESSAGES   ##
#############


Messages {
  Name = Standard

  mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = root@localhost = all, !skipped
  operator = root@localhost = mount
  console = all, !skipped, !saved
  append = "/var/lib/bacula/log" = all, !skipped
}


#
# Message delivery for daemon messages (no job).
Messages {
  Name = Daemon
  mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
  mail = root@localhost = all, !skipped            
  console = all, !skipped, !saved
  append = "/var/lib/bacula/log" = all, !skipped
}



############
##    POOLS    ##
############


# Default Pool for jobs, but will hold no actual volumes
Pool {
  Name = Default
  Pool Type = Backup
}

Pool {
  Name = MondayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 6d
  Accept Any Volume = yes
  Maximum Volume Jobs = 1
  Label Format = "Test-$Day$Month$Year"
}

Pool {
  Name = TuesdayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 6d
  Accept Any Volume = yes
  Maximum Volume Jobs = 1
  Label Format = "Test-$Day$Month$Year"
}

Pool {
  Name = WednesdayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 6d
  Accept Any Volume = yes
  Maximum Volume Jobs = 1
  Label Format = "Test-$Day$Month$Year"
}

Pool {
  Name = ThursdayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 6d
  Accept Any Volume = yes
  Maximum Volume Jobs = 1
  Label Format = "Test-$Day$Month$Year"
}

Pool {
  Name = FridayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 6d
  Accept Any Volume = yes
  Maximum Volume Jobs = 1
  Label Format = "Test-$Day$Month$Year"
}

Pool {
  Name = SaturdayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 6d
  Accept Any Volume = yes
  Maximum Volume Jobs = 1
  Label Format = "Test-$Day$Month$Year"
}

Pool {
  Name = SundayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 6d
  Accept Any Volume = yes
  Maximum Volume Jobs = 1
  Label Format = "Test-$Day$Month$Year"
}



############
## CONSOLES ##
############

#
# Restricted console used by tray-monitor to get the status of the director
#
Console {
  Name = Bacula-mon
  Password = ""
  CommandACL = status, .status
}
