#
# Default Bacula Director Configuration file
#
#  The only thing that MUST be changed is to add one or more
#   file or directory names in the Include directive of the
#   FileSet resource.
#
#  For Bacula release 7.0.5 (28 July 2014) -- redhat 
#
#  You might also want to change the default email address
#   from root to your address.  See the "mail" and "operator"
#   directives in the Messages resource.
#

Director {                            # define myself
  Name = diesel-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/etc/bacula/query.sql"
  WorkingDirectory = "/opt/bacula/working"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 20
  Messages = Daemon
}

# III. Job Defaults
@/etc/bacula/jobdefs/default.conf

# IV. Jobs
@/etc/bacula/clients/boltzmann.conf
@/etc/bacula/clients/gust.conf
@/etc/bacula/clients/cliff.conf
@/etc/bacula/clients/hawking.conf
@/etc/bacula/clients/nms.conf

# V. Schedules
@/etc/bacula/schedules/weekly.conf
@/etc/bacula/schedules/monthly.conf

# VI. Storage
@/etc/bacula/storage/lto.conf

# Backup the catalog database (after the nightly save)
Job {
  Name = "BackupCatalog"
  Client = diesel-fd
  JobDefs = "DefaultJob"
  Level = Full
  FileSet="Catalog"
  Schedule = "WeeklyCycleAfterBackup"
  RunBeforeJob = "/etc/bacula/make_catalog_backup.pl MyCatalog"
  RunAfterJob  = "/etc/bacula/delete_catalog_backup"
  Write Bootstrap = "/opt/bacula/working/%n.bsr"
  Priority = 11                   # run after main backup
}

#
# Standard Restore template, to be changed by Console program
#  Only one such job is needed for all Jobs/Clients/Storage ...
#
Job {
  Name = "RestoreFiles"
  Type = Restore
  Client=diesel-fd
  FileSet="Full Set"
  Storage = LTO-5
  Pool = Default
  Messages = Standard
  Where = /tmp/bacula-restores
}


# List of files to be backed up
FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
    }
    File = /sbin
  }
  Exclude {
    File = /opt/bacula/working
    File = /tmp
    File = /proc
    File = /tmp
    File = /sys
    File = /.journal
    File = /.fsck
  }
}


# This is the backup of the catalog
FileSet {
  Name = "Catalog"
  Include {
    Options {
      signature = MD5
    }
    File = "/opt/bacula/working/bacula.sql"
  }
}

# Client (File Services) to backup
Client {
  Name = diesel-fd
  Address = diesel
  FDPort = 9102
  Catalog = MyCatalog
  File Retention = 60 days            # 60 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}


# Generic catalog service
Catalog {
  Name = MyCatalog
}

# Reasonable message delivery -- send most everything to email address
#  and to the console
Messages {
  Name = Standard
  mailcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/sbin/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 = "/opt/bacula/log/bacula.log" = all, !skipped
  catalog = all
}


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

# Default pool definition
Pool {
  Name = Default
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Retention = 60 days          # 60 days
  Storage = LTO-5
}

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