#
# 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 1.36.2 (28 February 2005) -- solaris 5.10
#
#  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 = iserver-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/iserver/bacula/etc/query.sql"
  WorkingDirectory = "/iserver/bacula/var/bacula/working"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = "bacula"         # Console password
  Messages = Daemon
}

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Full
  Client = iserver-fd 
  Storage = QUANTUM
  Messages = Standard
  Pool = Default
  Priority = 10
#  SpoolData = yes
}

#
# Define the main nightly save backup job
#   By default, this job will back up to disk in /tmp
Job {
  Name = "Enterprise Backup"
  JobDefs = "DefaultJob"
  Schedule = "WeeklyCycle"
  FileSet = "Full Set"
  Write Bootstrap = "/iserver/bacula/var/bacula/working/enterprise-backup.bsr"
  Max Start Delay = 16h
  Max Wait Time = 16h
}
Job {
  Name = "Backup Amministrazione"
  JobDefs = "DefaultJob"
  Client = ammin-fd 
  Schedule = "AmminWeeklyCycle"
  FileSet = "AmminFileSet"
  Messages = AmminMessages
  Write Bootstrap = "/iserver/bacula/var/bacula/working/ammin-backup.bsr"
  Max Start Delay = 16h
  Max Wait Time = 16h
}
Job {
  Name = "Backup Aliseo"
  JobDefs = "DefaultJob"
  Client = aliseo-fd 
  Schedule = "AliseoWeeklyCycle"
  FileSet = "AliseoFileSet"
  Messages = AliseoMessages
  Write Bootstrap = "/iserver/bacula/var/bacula/working/aliseo-backup.bsr"
  Max Start Delay = 16h
  Max Wait Time = 16h
}
Job {
  Name = "Backup Office"
  JobDefs = "DefaultJob"
  Client = office-fd 
  Schedule = "OfficeWeeklyCycle"
  FileSet = "OfficeFileSet"
  Messages = OfficeMessages
  Write Bootstrap = "/iserver/bacula/var/bacula/working/office-backup.bsr"
  Max Start Delay = 16h
  Max Wait Time = 16h
}
#
# Define the test short save backup job
#   By default, this job will back up to disk in /tmp
#Job {
#  Name = "Short Backup"
#  JobDefs = "DefaultJob"
#  FileSet = "Short Set"
#  Write Bootstrap = "/iserver/bacula/var/bacula/working/short-backup.bsr"
#}

# Backup the catalog database (after the nightly save)
Job {
  Name = "BackupCatalog"
  JobDefs = "DefaultJob"
  Level = Full
  FileSet="Catalog"
  Schedule = "WeeklyCycleAfterBackup"
  # This creates an ASCII copy of the catalog
  RunBeforeJob = "/iserver/bacula/etc/make_catalog_backup bacula bacula"
  # This deletes the copy of the catalog
  RunAfterJob  = "/iserver/bacula/etc/end_of_backup.sh"
  Write Bootstrap = "/iserver/bacula/var/bacula/working/BackupCatalog.bsr"
  Priority = 11                   # run after main backup
  Max Start Delay = 16h
  Max Wait Time = 16h
}

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


# List of files to be backed up
FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
    }
    File = /etc
    File = /export/home/iserver
  }
  Exclude {
    File = /export/home/tmp
  }
}
FileSet {
  Name = "AmminFileSet"
  Include {
    Options {
      signature = MD5
    }
    File = /etc
    File = /u1
  }
  Exclude {
    File = /u1/tmp
  }
}
FileSet {
  Name = "AliseoFileSet"
  Include {
    Options {
      signature = MD5
    }
    File = /etc
    File = /u
    File = /u2
    File = /u/dos
  }
  Exclude {
    File = /u/tmp
    File = /u2/tmp
  }
}
FileSet {
  Name = "OfficeFileSet"
  Include {
    Options {
      signature = MD5
    }
    File = E:/
  }
}

#
# 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 = Level=Full Pool=MondayPool Monday at 11:00pm
  Run = Level=Full Pool=TuesdayPool Tuesday at 11:00pm
  Run = Level=Full Pool=WednesdayPool Wednesday at 11:00pm
  Run = Level=Full Pool=ThursdayPool Thursday at 11:00pm
  Run = Level=Full Pool=FridayPool Friday at 11:00pm
#  Run = Level=Full Pool=SaturdayPool Saturday at 11:00pm
}
Schedule {
  Name = "AmminWeeklyCycle"
  Run = Level=Full Pool=MondayPool Monday at 11:05pm
  Run = Level=Full Pool=TuesdayPool Tuesday at 11:05pm
  Run = Level=Full Pool=WednesdayPool Wednesday at 11:05pm
  Run = Level=Full Pool=ThursdayPool Thursday at 11:05pm
  Run = Level=Full Pool=FridayPool Friday at 11:05pm
#  Run = Level=Full Pool=SaturdayPool Saturday at 11:05pm
}
Schedule {
  Name = "AliseoWeeklyCycle"
  Run = Level=Full Pool=MondayPool Monday at 11:10pm
  Run = Level=Full Pool=TuesdayPool Tuesday at 11:10pm
  Run = Level=Full Pool=WednesdayPool Wednesday at 11:10pm
  Run = Level=Full Pool=ThursdayPool Thursday at 11:10pm
  Run = Level=Full Pool=FridayPool Friday at 11:10pm
#  Run = Level=Full Pool=SaturdayPool Saturday at 11:10pm
}
Schedule {
  Name = "OfficeWeeklyCycle"
  Run = Level=Full Pool=MondayPool Monday at 11:15pm
  Run = Level=Full Pool=TuesdayPool Tuesday at 11:15pm
  Run = Level=Full Pool=WednesdayPool Wednesday at 11:15pm
  Run = Level=Full Pool=ThursdayPool Thursday at 11:15pm
  Run = Level=Full Pool=FridayPool Friday at 11:15pm
#  Run = Level=Full Pool=SaturdayPool Saturday at 11:15pm
}


# This schedule does the catalog. It starts after the WeeklyCycle
Schedule {
  Name = "WeeklyCycleAfterBackup"
  Run = Level=Full Pool=MondayPool Monday at 11:25pm
  Run = Level=Full Pool=TuesdayPool Tuesday at 11:25pm
  Run = Level=Full Pool=WednesdayPool Wednesday at 11:25pm
  Run = Level=Full Pool=ThursdayPool Thursday at 11:25pm
  Run = Level=Full Pool=FridayPool Friday at 11:25pm
#  Run = Level=Full Pool=SaturdayPool Saturday at 11:25pm
}

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

# Client (File Services) to backup
Client {
  Name = iserver-fd
  Address = iserver
  FDPort = 9102
  Catalog = MyCatalog
  Password = "bacula"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 30 days            # 30 days
  AutoPrune = yes                     # Prune expired Jobs/Files
}
Client {
  Name = ammin-fd
  Address = sco.encodata.it
  FDPort = 9102
  Catalog = MyCatalog
  Password = "bacula"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 30 days            # 30 days
  AutoPrune = yes                     # Prune expired Jobs/Files
}
Client {
  Name = aliseo-fd
  Address = aix.encodata.it
  FDPort = 9102
  Catalog = MyCatalog
  Password = "bacula"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 30 days            # 30 days
  AutoPrune = yes                     # Prune expired Jobs/Files
}
Client {
  Name = office-fd
  Address = office.encodata.it
  FDPort = 9102
  Catalog = MyCatalog
  Password = "bacula"          # password for FileDaemon
  File Retention = 30 days            # 30 days
  Job Retention = 30 days            # 30 days
  AutoPrune = yes                     # Prune expired Jobs/Files
}

# Definiton of file storage device
Storage {
  Name = File
# Do not use "localhost" here    
  Address = iserver                # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "bacula"
  Device = FileStorage
  Media Type = File
}

# Definition of Quantum library storage device
#Storage {
#  Name = QUANTUM
#  Address = iserver          # N.B. Use a fully qualified name here
#  SDPort = 9103
#  Password = "bacula"          # password for Storage daemon
#  Device = QUANTUM             # must be same as Device in Storage daemon
#  Autochanger = Yes
#  Media Type = LIBRARY         # must be same as MediaType in Storage daemon
#}


# Definition of Quantum library storage device
Storage {
  Name = QUANTUM
  Address = iserver.encodata.it   # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "bacula"          # password for Storage daemon
  Device = QUANTUM             # must be same as Device in Storage daemon
  Media Type = LTO         # must be same as MediaType in Storage daemon
}

# Definition of DDS tape storage device
#Storage {
#  Name = DDS-4    
#  Do not use "localhost" here
#  Address = iserver                # N.B. Use a fully qualified name here
#  SDPort = 9103
#  Password = "4uEP+3HXdATNa1ar245ZVuRrIgAuAradzppqHY4GskQi"          # 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
#}

# Definition of 8mm tape storage device
#Storage {
#  Name = "8mmDrive"
#  Do not use "localhost" here
#  Address = iserver                # N.B. Use a fully qualified name here
#  SDPort = 9103
#  Password = "4uEP+3HXdATNa1ar245ZVuRrIgAuAradzppqHY4GskQi"
#  Device = "Exabyte 8mm"
#  MediaType = "8mm"
#}


# 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 = "/iserver/bacula/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/iserver/bacula/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = enterprise-backup@encodata.it = all, !skipped            
  operator = enterprise-backup@encodata.it = 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 = "/iserver/bacula/var/bacula/working/log" = all, !skipped
}
Messages {
  Name = AmminMessages
  mailcommand = "/iserver/bacula/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/iserver/bacula/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = ammin-backup@encodata.it = all, !skipped            
  operator = ammin-backup@encodata.it = mount
  console = all, !skipped, !saved
  append = "/iserver/bacula/var/bacula/working/log" = all, !skipped
}
Messages {
  Name = AliseoMessages
  mailcommand = "/iserver/bacula/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/iserver/bacula/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = aliseo-backup@encodata.it = all, !skipped            
  operator = aliseo-backup@encodata.it = mount
  console = all, !skipped, !saved
  append = "/iserver/bacula/var/bacula/working/log" = all, !skipped
}
Messages {
  Name = OfficeMessages
  mailcommand = "/iserver/bacula/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/iserver/bacula/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = office-backup@encodata.it = all, !skipped            
  operator = office-backup@encodata.it = mount
  console = all, !skipped, !saved
  append = "/iserver/bacula/var/bacula/working/log" = all, !skipped
}


#
# Message delivery for daemon messages (no job).
Messages {
  Name = Daemon
  mailcommand = "/iserver/bacula/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
  mail = enterprise-backup@encodata.it = all, !skipped            
  console = all, !skipped, !saved
  append = "/iserver/bacula/var/bacula/working/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
}

#Weekly Pools
Pool {
  Name = MondayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 10h
  Accept Any Volume = yes
  Maximum Volume Jobs = 5
  Recycle Current Volume = yes
#  Volume Use Duration = 10h
}
Pool {
  Name = TuesdayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 10h
  Accept Any Volume = yes
  Maximum Volume Jobs = 5
  Recycle Current Volume = yes
#  Volume Use Duration = 10h
}
Pool {
  Name = WednesdayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 10h
  Accept Any Volume = yes
  Maximum Volume Jobs = 5
  Recycle Current Volume = yes
#  Volume Use Duration = 10h
}
Pool {
  Name = ThursdayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 10h
  Accept Any Volume = yes
  Maximum Volume Jobs = 5
  Recycle Current Volume = yes
#  Volume Use Duration = 10h
}
Pool {
  Name = FridayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 10h
  Accept Any Volume = yes
  Maximum Volume Jobs = 5
  Recycle Current Volume = yes
#  Volume Use Duration = 10h
}
Pool {
  Name = SaturdayPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 10h
  Accept Any Volume = yes
  Maximum Volume Jobs = 5
  Recycle Current Volume = yes
#  Volume Use Duration = 10h
}
Pool {
  Name = TestPool
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 1min
  Accept Any Volume = yes
  Maximum Volume Jobs = 5
  Recycle Current Volume = yes
#  Volume Use Duration = 10h
}

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