Director {                            # define myself
  Name = baculaserver-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/etc/bacula/scripts/query.sql"
  WorkingDirectory = "/var/lib/bacula"
  PidDirectory = "/var/run/bacula"
  Maximum Concurrent Jobs = 1
  Password = "password"         # Console password
  Messages = Daemon
#  DirAddress = 127.0.0.1
}

JobDefs {
  Name = DefaultJob
  Type = Backup
  Level = Incremental
  Client = baculaserver-fd
  FileSet = "Full Set"
  Storage = LTO-4
  Messages = Standard
  Pool = Default
  Priority = 10
  Write Bootstrap = "/var/lib/bacula/%c.bsr"
}

# Backup the catalog database (after the nightly save)
Job {
  Name = MountTape
  Type = Admin
  Client = baculaserver-fd
  Schedule = WeeklyCycleBeforeBackup
  Priority = 9
  Messages = Standard
  Pool = Default
  FileSet = "Full Set"
  Storage = LTO-4
  Run Before Job = /etc/bacula/scripts/mount-tape
}

Job {
  Name = EjectTape
  Type = Admin
  Client = baculaserver-fd
  Schedule = WeeklyCycleAfterBackup
  Priority = 12
  Messages = Standard
  Pool = Default
  FileSet = "Full Set"
  Storage = LTO-4
  Run After Job = /etc/bacula/scripts/eject-tape
}

# Standard Restore template, changed by Console program
Job {
  Name = "RestoreFiles"
  Type = Restore
  Client = baculaserver-fd
  FileSet = "Full Set"
  Storage = LTO-4
  Messages = Standard
  Pool = Default
  Where = /tmp/bacula-restores
}

# List of files to be backed up
FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
    }
#
#  Put your list of files here, preceded by 'File =', one per line
#    or include an external list with:
#
#    File = <file-name
#
#  Note: / backs up everything on the root partition.
#    if you have other partitions such as /usr or /home
#    you will probably want to add them too.
#
#  By default this is defined to point to the Bacula binary
#    directory to give a reasonable FileSet to backup to
#    disk storage during initial testing.
#
    File = /usr/sbin
  }

#
# If you backup the root directory, the following two excluded
#   files can be useful
#
  Exclude {
    File = /var/lib/bacula
    File = /nonexistant/path/to/file/archive/dir
    File = /proc
    File = /tmp
    File = /.journal
    File = /.fsck
  }
}

Schedule {
  Name = "WeeklyCycleBeforeBackup"
  Run = Level=Full Pool=MondayPool Tuesday at 02:00
  Run = Level=Full Pool=TuesdayPool Wednesday at 02:00
  Run = Level=Full Pool=WednesdayPool Thursday at 02:00
  Run = Level=Full Pool=ThursdayPool Friday at 02:00
  Run = Level=Full Pool=WeeklyPool Saturday at 02:00
}

Schedule {
  Name = "WeeklyCycle"
  Run = Level=Full Pool=MondayPool Tuesday at 02:05
  Run = Level=Full Pool=TuesdayPool Wednesday at 02:05
  Run = Level=Full Pool=WednesdayPool Thursday at 02:05
  Run = Level=Full Pool=ThursdayPool Friday at 02:05
  Run = Level=Full Pool=WeeklyPool Saturday at 02:05
}

# This does the catalog. It starts after the WeeklyCycle
Schedule {
  Name = "WeeklyCycleCatalogBackup"
  Run = Level=Full Pool=MondayPool Tuesday at 04:00
  Run = Level=Full Pool=TuesdayPool Wednesday at 04:00
  Run = Level=Full Pool=WednesdayPool Thursday at 04:00
  Run = Level=Full Pool=ThursdayPool Friday at 04:00
  Run = Level=Full Pool=WeeklyPool Saturday at 04:00
}

Schedule {
  Name = "WeeklyCycleAfterBackup"
  Run = Level=Full Pool=MondayPool Tuesday at 04:05
  Run = Level=Full Pool=TuesdayPool Wednesday at 04:05
  Run = Level=Full Pool=WednesdayPool Thursday at 04:05
  Run = Level=Full Pool=ThursdayPool Friday at 04:05
  Run = Level=Full Pool=WeeklyPool Saturday at 04:05
}

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

# Definition of LTO-4 storage device
Storage {
  Name = LTO-4
  # Do not use "localhost" here
  Address = baculaserver.mycompany.name
  SDPort = 9103
  Password = password
  Device = LTO-4
  Media Type = LTO-4
  Maximum Concurrent Jobs = 1
  Heartbeat interval = 1 minutes
}

# Generic catalog service
Catalog {
  Name = MyCatalog
  dbname = bacula; DB Address = ""; dbuser = "bacula"; dbpassword = "GQ0HA2p5gvfc"
}

# Reasonable message delivery -- send most everything to email address
#  and to the console
Messages {
  Name = Standard
#
# NOTE! If you send to two email or more email addresses, you will need
#  to replace the %r in the from field (-f part) with a single valid
#  email address in both the mailcommand and the operatorcommand.
#  What this does is, it sets the email address that emails would display
#  in the FROM field, which is by default the same email as they're being
#  sent to.  However, if you send email to more than one address, then
#  you'll have to set the FROM address manually, to a single address.
#  for example, a 'no-reply@mydomain.com', is better since that tends to
#  tell (most) people that its coming from an automated source.

#
  mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\bacula@mycompany.name\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"bacula@mycompany.name\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = notification@mycompany.name = all, !skipped, !terminate
  operator = notification@mycompany.name = mount
  console = all, !skipped, !saved
#
# WARNING! the following will create a file that you must cycle from
#          time to time as it will grow indefinitely. However, it will
#          also keep all your messages if they scroll off the console.
#
  append = "/var/lib/bacula/log" = all, !skipped
  catalog = all
}


#
# Message delivery for daemon messages (no job).
#

Messages {
  Name = Daemon
  mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"bacula@baculaserver.mycompany.name\" -s \"Bacula daemon message\" %r"
  mail = notification@mycompany.name = all, !skipped
  console = all, !skipped, !saved
  append = "/var/lib/bacula/log" = all, !skipped
  catalog = all
}

#
# Backup Pools
#

# Default pool definition
Pool {
  Name = Default
  Pool Type = Backup
}

Pool {
  Name = MondayPool
  Pool Type = Backup
  Recycle = yes
  RecyclePool = MondayPool
  AutoPrune = yes
  Volume Retention = 5d
  Volume Use Duration = 2d
}

Pool {
  Name = TuesdayPool
  Pool Type = Backup
  Recycle = yes
  RecyclePool = TuesdayPool
  AutoPrune = yes
  Volume Retention = 5d
  Volume Use Duration = 2d
}

Pool {
  Name = WednesdayPool
  Pool Type = Backup
  Recycle = yes
  RecyclePool = WednesdayPool
  Volume Retention = 5d
  Volume Use Duration = 2d
}

Pool {
  Name = ThursdayPool
  Pool Type = Backup
  Recycle = yes
  RecyclePool = ThursdayPool
  AutoPrune = yes
  Volume Retention = 5d
  Volume Use Duration = 2d
}

Pool {
  Name = WeeklyPool
  Pool Type = Backup
  Recycle = yes
  RecyclePool = WeeklyPool
  AutoPrune = yes
  Volume Retention = 5d
  Volume Use Duration = 2d
}

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


# Configuration for clients

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

FileSet {
  Name = "baculaclient-fileset"
  Include {
    File = /etc/
    File = /opt/
    File = /home/
    File = /root/
    File = /var/backups/mysql/ultima
    File = /var/www/
    Options {
      signature = MD5
    }
  }
}

Job {
  Name = "NightlySaveBaculaclient"
  JobDefs = "DefaultJob"
  Level = Full
  Client = baculaclient-fd
  FileSet = baculaclient-fileset
  Schedule = WeeklyCycle
  Write Bootstrap = "/var/lib/bacula/NightlySaveBaculaclient.bsr"
  Max Start Delay = 12h
}

[....]


