#
# 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 3.0.1 (30 April 2009) -- 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 = bacula03-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/usr/lib64/bacula/query.sql"
  WorkingDirectory = "/var/lib/bacula"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 20
  Password = "stary.70"         # Console password
  Messages = Daemon
}

# Include all subfiles 
# Remember to "reload" the Director after modifying or adding a subfile
# sure that all subfiles are owned root:bacula
#   e.g          chmod root:bacula /etc/bacula/jobs*

@|"sh -c 'for f in /etc/bacula/clients/*.conf ; do echo @${f} ; done'"
@|"sh -c 'for f in /etc/bacula/storage/*.conf ; do echo @${f} ; done'"
@|"sh -c 'for f in /etc/bacula/backupDefinitions/*.conf ; do echo @${f} ; done'"
@|"sh -c 'for f in /etc/bacula/backupDefinitions/jobs/Protected/*.conf ; do echo @${f} ; done'"
@|"sh -c 'for f in /etc/bacula/backupDefinitions/jobs/Assets/*.conf ; do echo @${f} ; done'"
@|"sh -c 'for f in /etc/bacula/backupDefinitions/jobs/Critical/*.conf ; do echo @${f} ; done'"
@|"sh -c 'for f in /etc/bacula/backupDefinitions/jobs/Critical/Databases/*.conf ; do echo @${f} ; done'"
@|"sh -c 'for f in /etc/bacula/backupDefinitions/jobs/Critical/Systems/*.conf ; do echo @${f} ; done'"
@|"sh -c 'for f in /etc/bacula/backupDefinitions/jobs/Critical/VM/*.conf ; do echo @${f} ; done'"
@|"sh -c 'for f in /etc/bacula/backupDefinitions/jobs/Critical/VM/conf/*.conf ; do echo @${f} ; done'"



# @|"sh -c 'find /etc/bacula/backupDefinitions -type f -name \*.conf | xargs -I{} echo @{}'"





#  _____       ___   _____       ___   _       _____   _____  
# /  ___|     /   | |_   _|     /   | | |     /  _  \ /  ___| 
# | |        / /| |   | |      / /| | | |     | | | | | |     
# | |       / / | |   | |     / / | | | |     | | | | | |  _  
# | |___   / /  | |   | |    / /  | | | |___  | |_| | | |_| | 
# \_____| /_/   |_|   |_|   /_/   |_| |_____| \_____/ \_____/ 


# Generic catalog service
Catalog {
  Name = MyCatalog
# Uncomment the following line if you want the dbi driver
 dbdriver = "dbi:postgresql"; dbaddress = "bacula03.drd.int"; dbport = 5432
 dbname = "bacula"; dbuser = "bacula"; dbpassword = "bacula01"
}

#      ___  ___   _____   _____   _____       ___   _____   _____   _____  
#     /   |/   | | ____| /  ___/ /  ___/     /   | /  ___| | ____| /  ___/ 
#    / /|   /| | | |__   | |___  | |___     / /| | | |     | |__   | |___  
#   / / |__/ | | |  __|  \___  \ \___  \   / / | | | |  _  |  __|  \___  \ 
#  / /       | | | |___   ___| |  ___| |  / /  | | | |_| | | |___   ___| | 
# /_/        |_| |_____| /_____/ /_____/ /_/   |_| \_____/ |_____| /_____/ 

# 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/sbin/bsmtp -h localhost -f \"\(Bacula\) \<do-not-reply@bacula03.drd.int\>\" -s \"Bacula: %t %e of %i - %n %l\" %r"
  operatorcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) \<do-not-reply@bacula03.drd.int\>\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = dataops@drdstudios.com = all, !skipped            
  operator = dataops@drdstudios.com = 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, !skipped, !saved
}


#
# Message delivery for daemon messages (no job).
Messages {
  Name = Daemon
  mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) \<do-not-reply@bacula03.drd.int\>\" -s \"Bacula daemon message\" %r"
  mail = dataops@drdstudios.com = all, !skipped            
  console = all, !skipped, !saved
  append = "/var/lib/bacula/log" = all, !skipped
}

#  _____   _____   __   _   _____   _____   _       _____  
# /  ___| /  _  \ |  \ | | /  ___/ /  _  \ | |     | ____| 
# | |     | | | | |   \| | | |___  | | | | | |     | |__   
# | |     | | | | | |\   | \___  \ | | | | | |     |  __|  
# | |___  | |_| | | | \  |  ___| | | |_| | | |___  | |___  
# \_____| \_____/ |_|  \_| /_____/ \_____/ |_____| |_____| 

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


#  _____   _____   _____   _       _____  
# |  _  \ /  _  \ /  _  \ | |     /  ___/ 
# | |_| | | | | | | | | | | |     | |___  
# |  ___/ | | | | | | | | | |     \___  \ 
# | |     | |_| | | |_| | | |___   ___| | 
# |_|     \_____/ \_____/ |_____| /_____/ 


# Default pool definition
Pool {
  Name = Scratch
  Pool Type = Backup
  Cleaning Prefix = "CLNU"
}

# Restore Job

Job {
  Name = "Restore"
  Type = Restore
  Pool = Scratch
  Client=bacula03-fd
  FileSet="Catalog"
  Storage = TS3200 
  Messages = Standard
  Where = /bacula-restores
}

