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

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Incremental
  Client = backup-fd 
  FileSet = "Full Set"
  Schedule = "WeeklyCycle"
  Storage = File
  Messages = Standard
  Pool = Default
  Priority = 10
}


#
# Define the main nightly save backup job
#   By default, this job will back up to disk in /tmp
Job {
  Name = "Client1"
  JobDefs = "DefaultJob"
  Write Bootstrap = "/var/bacula/Client1.bsr"
}


# List of files to be backed up
FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
    }
    File = /bacula/bacula-1.38.11
  }

#
# If you backup the root directory, the following two excluded
#   files can be useful
#
  Exclude {
    File = /proc
    File = /tmp
    File = /.journal
    File = /.fsck
  }
}

#
# When to do the backups, full backup on first sunday of the month,
#  differential (i.e. incremental since full) every other sunday,
#  and incremental backups other days
Schedule {
  Name = "WeeklyCycle"
  Run = Full 1st sun at 23:05
  Run = Differential 2nd-5th sun at 23:05
  Run = Incremental mon-sat at 23:05
}


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

# Definition of DDS tape storage device
Storage {
  Name = File    
  Address = 10.7.1.18
  SDPort = 9103
  Password = "qNgAreS6w/39QeKfGbSR2wXavirgVlpQ8H8pzP0T5Vkm"          # password for Storage daemon
  Device = DDS-4                      # must be same as Device in Storage daemon
  Media Type = DDS-4                  # must be same as MediaType in Storage daemon
  Autochanger = yes                   # enable for autochanger device
}

# Generic catalog service
Catalog {
  Name = MyCatalog
  dbname = bacula; user = bacula; password = ""
}

# 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.
#
  mailcommand = "/usr/sbin/bsmtp -h 10.8.1.10 -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/sbin/bsmtp -h 10.8.1.10 -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = quanzhong.zhang@xjtlu.edu.cn = all, !skipped            
  operator = quanzhong.zhang@xjtlu.edu.cn = 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/bacula/log" = all, !skipped
}


#
# Message delivery for daemon messages (no job).
Messages {
  Name = Daemon
  mailcommand = "/usr/sbin/bsmtp -h 10.8.1.10 -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
  mail = quanzhong.zhang@xjtlu.edu.cn = all, !skipped            
  console = all, !skipped, !saved
  append = "/var/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 = 365 days         # one year
  Accept Any Volume = yes             # write on any volume in the pool
}

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