#   For Bacula release 2.4.2 (26 July 2008) -- redhat 

Director {
  Name = backup-dir
  DIRport = 9101
  QueryFile = "/rnd/apps/servers/bacula/etc/query.sql"
  WorkingDirectory = "/rnd/apps/servers/bacula/var"
  PidDirectory = "/rnd/apps/servers/bacula/pid"
  Maximum Concurrent Jobs = 200
  Messages = Standard
}
########################################################
##############################################
###################################
##################


####################################
#                                  #
#        backup.mydomain.it        #
#                                  #
####################################

Client {
  Name = backup-fd
  Catalog = MyCatalog
  File Retention = 30 days
  Job Retention = 30 days
  Heartbeat Interval = 1m
}

Job {
  Name = "backup_mydomain_it_e_Catalog"
  Schedule = "WeeklyCycle_f2"
  JobDefs = "backup_mydomain_it_DefaultJob"
  FileSet="backup_mydomain_it_e_Catalog"
  #
  # This creates an ASCII copy of the catalog
  # WARNING!!! Passing the password via the command line is insecure.
  # see comments in make_catalog_backup for details.
  # Arguments to make_catalog_backup are:
  #  make_catalog_backup <database-name> <user-name> <password> <host>
  #
  # This deletes the copy of the catalog
  # RunAfterJob  = "/rnd/apps/servers/bacula/bin/delete_catalog_backup"
  Write Bootstrap = "/rnd/apps/servers/bacula/var/BackupCatalog.bsr"
  Priority = 11                   # run after main backup
}



Job {
  Name = "Restore"
  Messages = Standard
  Type = Restore
  FileSet="backup_mydomain_it_e_Catalog"
  Where = /rnd/bacula-restores
  Client = dev-01.mydomain.it
#  Schedule = "WeeklyCycle"
  Storage = bacula-sd1-file
  Priority = 8
  Pool = backup_mydomain_it_file
  Replace = never
#  Write Bootstrap = /rnd/apps/servers/bacula/var/%n.bsr
}


FileSet {
  Name = "backup_mydomain_it_e_Catalog"
  Include {
    Options {
      signature = MD5
    }
    File = /
    # File = /rnd/apps/servers/bacula/var/bacula.sql
  }
  Exclude {
    File = /dati1
    File = /dati2
    File = /dati3
    File = /dev
    File = /sys
    File = /proc
    File = /tmp
    File = /mnt
    File = /media
    File = /.autofsck
  }
}


FileSet {
  Name = "backup.mydomain.it_dati3_bacula_backups"
  Include {
    Options {
      signature = MD5
    }
    File = /dati3/bacula_backups
  }
}




####################################
#                                  #
#          noc.mydomain.it             #
#                                  #
####################################

Client {
  Name = noc.mydomain.it
  Catalog = MyCatalog
  File Retention = 30 days
  Job Retention = 30 days
}

Job {
  Name = "noc.mydomain.it_mysql"
  Client = noc.mydomain.it
  Schedule = "WeeklyCycle_f2"
  JobDefs = "backup_mydomain_it_DefaultJob"
#  Write Bootstrap = "/rnd/apps/servers/bacula/var/noc.mydomain.it.bsr"
  FileSet="solo_mysql"
  ClientRunBeforeJob = "/rnd/userbin/stm.sh mbb"
  ClientRunAfterJob  = "/rnd/userbin/stm.sh mab"
}

Job {
  Name = "noc.mydomain.it_tutto_tranne_mysql"
  Client = noc.mydomain.it
  Schedule = "WeeklyCycle_f2"
  JobDefs = "backup_mydomain_it_DefaultJob"
#  Write Bootstrap = "/rnd/apps/servers/bacula/var/noc.mydomain.it_tutto_tranne_mysql.bsr"
  FileSet="tutto_tranne_mysql"
}

FileSet {
  Name = "solo_mysql"
  Include {
    Options {
      signature = MD5
    }
   File = /rnd/apps/mydomain/mysqld-chroot/rnd/apps/servers/mysql/data
  }
}

FileSet {
  Name = "tutto_tranne_mysql"
  Include {
    Options {
      signature = MD5
      compression = GZIP
    }
   File = /
   File = /rnd
  }
  Exclude {
    File = /dev
    File = /sys
    File = /proc
    File = /tmp
    File = /mnt
    File = /media
    File = /.autofsck
    File = /rnd/apps/mydomain/mysqld-chroot/rnd/apps/servers/mysql/data
    File = /rnd/data/mysql
    File = /rnd/archives/system
    File = /rnd/archives/backup
    File = /rnd/apps/mydomain/mysqld-chroot/rnd/data/mysql
    File = /rnd/data/dumps
    File = /rnd/VMs
  }
}

FileSet {
  Name = "tutto_tranne_mysql_separate_home"
  Include {
    Options {
      signature = MD5
      compression = GZIP
    }
   File = /
   File = /rnd
   File = /home
  }
  Exclude {
    File = /dev
    File = /sys
    File = /proc
    File = /tmp
    File = /mnt
    File = /media
    File = /.autofsck
    File = /rnd/data/dumps
    File = /rnd/apps/mydomain/mysqld-chroot/rnd/apps/servers/mysql/data
    File = /rnd/data/mysql
    File = /rnd/apps/mydomain/mysqld-chroot/rnd/data/mysql
    File = /rnd/archives/system
    File = /rnd/archives/backup
    File = /rnd/VMs
  }
}

FileSet {
  Name = "svn"
  Include {
    Options {
      signature = MD5
      compression = GZIP
    }
   File = /rnd/apps/mydomain/store
   File = /rnd/apps/repos
  }
}
FileSet {
  Name = "mysql_backup"
  Include {
    Options {
      signature = MD5
      compression = GZIP
    }
   File = /rnd/archives/backup
  }
}


FileSet {
  Name = "solo_mysql_var_lib"
  Include {
    Options {
      signature = MD5
    }
   File = /var/lib/mysql
  }
}

####################################
FileSet {
  Name = "test_fileset"
  Include {
    Options {
      signature = MD5
    }
   File = /rnd/bin
  }
}

####################################
#                                  #
#          log.mydomain.it             #
#                                  #
####################################

Client {
  Name = log.mydomain.it
  Catalog = MyCatalog
  File Retention = 30 days
  Job Retention = 30 days
}

Job {
  Name = "log.mydomain.it_tutto"
  Client = log.mydomain.it
  JobDefs = "backup_mydomain_it_DefaultJob"
#  Write Bootstrap = "/rnd/apps/servers/bacula/var/log.mydomain.it_tutto.bsr"
  FileSet="tutto"
}

FileSet {
  Name = "tutto"
  Include {
    Options {
      signature = MD5
    }
   File = /
   File = /rnd
   File = /dati
  }
  Exclude {
    File = /dev
    File = /sys
    File = /proc
    File = /tmp
    File = /mnt
    File = /media
    File = /.autofsck
    File = /rnd/VMs
   }
}



####################################
#                                  #
#        bacula-sd1.mydomain.it        #
#                                  #
####################################

Client {
  Name = bacula-sd1.mydomain.it
  Catalog = MyCatalog
  File Retention = 30 days
  Job Retention = 30 days
  Maximum Concurrent Jobs = 20
}


Job {
  Name = "bacula-sd1.mydomain.it_tutto"
  JobDefs = "bacula-sd1_mydomain_it_DefaultJob"
#  Write Bootstrap = "/rnd/apps/servers/bacula/var/bacula-sd1.mydomain.it_tutto.bsr"
  FileSet="tutto1"
}


FileSet {
  Name = "rnd_data"
  Include {
    Options {
      signature = MD5
    }
   File = /rnd/data
   File = /rnd/dataiscsi
  }
}

FileSet {
  Name = "tutto1"
  Include {
    Options {
      signature = MD5
    }
   File = /
   File = /rnd
  }
  Exclude {
    File = /dev
    File = /sys
    File = /proc
    File = /tmp
    File = /mnt
    File = /media
    File = /.autofsck
    File = /rnd/data
    File = /rnd/dataiscsi
    File = /rnd/VMs
  }
}


####################################
#                                  #
#        cms-01.mydomain.it            #
#                                  #
####################################

Client {
  Name = cms-01.mydomain.it
  Catalog = MyCatalog
  File Retention = 30 days
  Job Retention = 30 days
}

Job {
  Name = "cms-01.mydomain.it_tutto_tranne_mysql"
  Client = cms-01.mydomain.it
  Schedule = "WeeklyCycle_f2"
  JobDefs = "bacula-sd1_mydomain_it_DefaultJob"
#  Write Bootstrap = "/rnd/apps/servers/bacula/var/cms-01.mydomain.it_tutto_tranne_mysql.bsr"
  FileSet="tutto_tranne_mysql"
  ClientRunBeforeJob = "/rnd/bin/bacula/bacula_pre_bck.sh"
  ClientRunAfterJob  = "/rnd/bin/bacula/bacula_post_bck.sh"
}


####################################
#                                  #
#          dev-01.mydomain.it          #
#                                  #
####################################

Client {
  Name = dev-01.mydomain.it
  Catalog = MyCatalog
  File Retention = 30 days
  Job Retention = 30 days
}

Job {
  Name = "dev-01.mydomain.it_tutto_tranne_mysql"
  Client = dev-01.mydomain.it
  JobDefs = "bacula-sd1_tutto_tranne_mysql"
}

Job {
  Name = "dev-01.mydomain.it_mysql"
  Client = dev-01.mydomain.it
  JobDefs = "bacula-sd1_mydomain_it_DefaultJob"
#  Write Bootstrap = "/rnd/apps/servers/bacula/var/dev-01.mydomain.it_mysql.bsr"
  FileSet="solo_mysql"
  ClientRunBeforeJob = "/rnd/userbin/stm.sh mt"
  #ClientRunAfterJob  = "/rnd/userbin/stm.sh ms"
  RunScript {
    Command = "/rnd/userbin/stm.sh ms"
    RunsWhen = After
    RunsOnClient = yes
    RunsOnFailure = yes
    RunsOnSuccess = yes
  }
}

Job {
  Name = "dev-01.mydomain.it_solo_bin"
  Client = dev-01.mydomain.it
  JobDefs = "bacula-sd1_mydomain_it_DefaultJob"
#  Write Bootstrap = "/rnd/apps/servers/bacula/var/dev-01.mydomain.it_solo_bin.bsr"
  FileSet="solo_bin"
  Schedule = "feriale_ogni_ora_dev0102"
}

FileSet {
  Name = "solo_bin"
  Include {
    Options {
      signature = MD5
      wilddir = /rnd/apps/mydomain/httpd-chroot/home/*/bin
    }
  }
}



###############################################
#                                             #
#                   JobDefs                   #
#                                             #
###############################################
JobDefs {
  Name = "backup_mydomain_it_DefaultJob"
  Type = Backup
  Level = Incremental
  Client = backup-fd 
  Schedule = "WeeklyCycle"
  Storage = backup_mydomain_it-File
  Messages = Standard
  Priority = 10
  Pool = backup_mydomain_it_file
  Write Bootstrap = /rnd/apps/servers/bacula/var/%n.bsr
  RunAfterJob  = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
  Maximum Concurrent Jobs = 10
}

JobDefs {
  Name = "backup_mydomain_it_Drive2"
  Type = Backup
  Level = Incremental
  Client = backup-fd 
  Schedule = "WeeklyCycle"
  Storage = backup_mydomain_it-Drive-2
  Messages = Standard
  Priority = 10
  Pool = backup_mydomain_it_drive2
  Write Bootstrap = /rnd/apps/servers/bacula/var/%n.bsr
  RunAfterJob  = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
  Maximum Concurrent Jobs = 10
}

JobDefs {
  Name = "backup_mydomain_it_svn"
  Type = Backup
  Level = Incremental
  FileSet = "svn"
  Client = backup-fd 
  Schedule = "ogni_12ore"
  Storage = backup_mydomain_it-File
  Messages = Standard
  Priority = 10
  Pool = backup_mydomain_it_file
  Write Bootstrap = /rnd/apps/servers/bacula/var/%n.bsr
  RunAfterJob  = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
  Maximum Concurrent Jobs = 10
}

JobDefs {
  Name = "backup_mydomain_it_mysql-file"
  Type = Backup
  Level = Incremental
  FileSet = "mysql_backup"
  Client = backup-fd 
  Schedule = "WeeklyCycle_f2"
  Storage = backup_mydomain_it-File
  Messages = Standard
  Priority = 10
  Pool = backup_mydomain_it_file
  Write Bootstrap = /rnd/apps/servers/bacula/var/%n.bsr
  RunAfterJob  = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
  RunScript {
#    Command = "/rnd/bin/bacula/bacula_post_mybck.sh %e %j %n %t %v"
    Command = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
    RunsWhen = After
    RunsOnClient = yes
    RunsOnFailure = yes
    RunsOnSuccess = yes
  }
  Max Run Time = 3h
  Maximum Concurrent Jobs = 10
}

JobDefs {
  Name = "bacula-sd1_mydomain_it_DefaultJob"
  Type = Backup
  Level = Incremental
  Client = bacula-sd1.mydomain.it
  Schedule = "WeeklyCycle_f2"
  Storage = bacula-sd1-file
  Messages = Standard
  Priority = 10
  Pool = bacula_sd1_mydomain_it_file
  Write Bootstrap = /rnd/apps/servers/bacula/var/%n.bsr
#  RunAfterJob  = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
  RunScript {
    Command = "/rnd/bin/bacula/bacula_post_bck.sh %e %j %n %t %v"
#    Command = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
    RunsWhen = After
    RunsOnClient = yes
    RunsOnFailure = yes
    RunsOnSuccess = yes
  }
  RunScript {
    Command = "/rnd/bin/bacula/bacula_pre_bck.sh %e %j %n %t %v"
#    Command = "/rnd/apps/servers/bacula/bin/bacula_pre_bck.sh %c %e %j %n %t %v"
    RunsWhen = Before
    RunsOnClient = yes
    RunsOnFailure = yes
    RunsOnSuccess = yes
  }
  Maximum Concurrent Jobs = 10
}

JobDefs {
  Name = "bacula-sd1_tutto_tranne_mysql"
  FileSet="tutto_tranne_mysql"
  Type = Backup
  Level = Incremental
  Client = bacula-sd1.mydomain.it
  Schedule = "WeeklyCycle_f2"
  Storage = bacula-sd1-file
  Messages = Standard
  Priority = 10
  Pool = bacula_sd1_mydomain_it_file
  Write Bootstrap = /rnd/apps/servers/bacula/var/%n.bsr
  ClientRunBeforeJob = "/rnd/bin/bacula/bacula_pre_bck.sh %e %j %n %t %v"
  ClientRunAfterJob  = "/rnd/bin/bacula/bacula_post_bck.sh %e %j %n %t %v"
  RunAfterJob  = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
  Maximum Concurrent Jobs = 10
}

JobDefs {
  Name = "bacula-sd1_tutto_tranne_mysql_home"
  FileSet="tutto_tranne_mysql_separate_home"
  Type = Backup
  Level = Incremental
  Client = bacula-sd1.mydomain.it
  Schedule = "WeeklyCycle_f2"
  Storage = bacula-sd1-file
  Messages = Standard
  Priority = 10
  Pool = bacula_sd1_mydomain_it_file
  Write Bootstrap = /rnd/apps/servers/bacula/var/%n.bsr
  ClientRunBeforeJob = "/rnd/bin/bacula/bacula_pre_bck.sh %e %j %n %t %v"
  ClientRunAfterJob  = "/rnd/bin/bacula/bacula_post_bck.sh %e %j %n %t %v"
  RunAfterJob  = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
  Maximum Concurrent Jobs = 10
}

JobDefs {
  Name = "bacula-sd1_mysql"
  FileSet="solo_mysql"
  Type = Backup
  Level = Incremental
  Client = bacula-sd1.mydomain.it
  Schedule = "WeeklyCycle_f2"
  Storage = bacula-sd1-file
  Messages = Standard
  Priority = 10
  Pool = bacula_sd1_mydomain_it_file
  Write Bootstrap = /rnd/apps/servers/bacula/var/%n.bsr
  ClientRunBeforeJob = "/rnd/bin/bacula/bacula_pre_mybck.sh %e %j %n %t %v"
#  ClientRunAfterJob  = "/rnd/bin/bacula/bacula_post_mybck.sh %e %j %n %t %v"
  RunAfterJob  = "/rnd/apps/servers/bacula/bin/bacula_post_bck.sh %c %e %j %n %t %v"
  RunScript {
    Command = "/rnd/bin/bacula/bacula_post_mybck.sh %e %j %n %t %v"
    RunsWhen = After
    RunsOnClient = yes
    RunsOnFailure = yes
    RunsOnSuccess = yes
  }
  Max Run Time = 3h
  Maximum Concurrent Jobs = 10
}

###############################################
#                                             #
#                schedules                    #
#                                             #
###############################################

Schedule {
  Name = "solo_lunedi_su_backup_mydomain_it"
  Run = Level=Full mon at 9:00
}

Schedule {
  Name = "solo_lunedi_su_bacula-sd1_mydomain_it"
  Run = Level=Full mon at 9:00
}

Schedule {
  Name = "WeeklyCycle"
  Run = Full 1st sun at 20:00
  Run = Differential 2nd-5th sun at 20:00
  Run = Incremental mon-sat at 20:00
}

Schedule {
  Name = "WeeklyCycle_f2"
  Run = Full 2nd sun at 20:00
  Run = Differential 1st sun at 20:00
  Run = Differential 3rd-5th sun at 20:00
  Run = Incremental mon-sat at 20:00
}

Schedule {
  Name = "geometry_mysql"
  Run = Full 1st sun at 02:00
  Run = Differential 2nd-5th sun at 02:00
  Run = Incremental mon-sat at 02:00
}

Schedule {
  Name = "feriale_ogni_ora_dev0102"
  Run = Incremental mon-fri at 09:00
  Run = Incremental mon-fri at 10:00
  Run = Incremental mon-fri at 11:00
  Run = Incremental mon-fri at 12:00
  Run = Incremental mon-fri at 13:00
  Run = Incremental mon-fri at 14:00
  Run = Incremental mon-fri at 15:00
  Run = Incremental mon-fri at 16:00
  Run = Incremental mon-fri at 17:00
  Run = Incremental mon-fri at 18:00
}

Schedule {
  Name = "ogni_12ore"
  Run = Full sun at 13:00
  Run = Incremental mon-sat at 01:00
  Run = Incremental mon-sat at 13:00
}

###############################################
#                                             #
#           dispositivi di storage            #
#                                             #
###############################################

# Definition of file storage device
Storage {
  Name = backup_mydomain_it-File
  # Do not use "localhost" here    
  SDPort = 9103
  Device = backup_mydomain_it-FileStorage
  Media Type = File
  Maximum Concurrent Jobs = 12
  Heartbeat Interval = 55
}

Storage {
  Name = backup_mydomain_it-Drive-1    
  #  Do not use "localhost" here
  SDPort = 9103
  Device = backup_mydomain_it-Drive-1
  Media Type = SDLT-1
  Heartbeat Interval = 55
}

Storage {
  Name = backup_mydomain_it-Drive-2
  #  Do not use "localhost" here
  SDPort = 9103
  Device = backup_mydomain_it-Drive-2
  Media Type = SDLT-1
  Heartbeat Interval = 55
}

Storage {
  Name = bacula-sd1-lto2
  #  Do not use "localhost" here
  SDPort = 9103
  Device = bacula-sd1-Drive-1
  Media Type = LTO2
  Heartbeat Interval = 55
}

Storage {
  Name = bacula-sd1-file
  #  Do not use "localhost" here
  SDPort = 9103
  Device = bacula-sd1-FileStorage
  Media Type = File
  Maximum Concurrent Jobs = 12
  Heartbeat Interval = 55
}

############################################
# Generic catalog service
#
Catalog {
  Name = MyCatalog
}


###############################################
#                                             #
#                Pools                        #
#                                             #
###############################################
Pool {
  Name = bacula_sd1_mydomain_it_file
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 20 days
  Maximum Volumes = 3  # perche' il filesystem e' 500 GB
  #
  # l'LTO contiene 200 GB in tutto, quindi 100 GB di bacula,
  # che corrispondono a 93x1024x1024x1024 + 80 GB provenienti da I.Net  (stando a marzo 2009) + 20 GB a disposizione di I.Net
  #  
  #Maximum Volume Bytes = 93G
  Maximum Volume Bytes = 100GB

# Per il Copy Job
  Storage = bacula-sd1-file
  NextPool = bacula_sd1_mydomain_it_drive1
}

Pool {
  Name = bacula_sd1_mydomain_it_drive1
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 30 days

# Per il Copy Job
  Storage = bacula-sd1-lto2
}

Pool {
  Name = backup_mydomain_it_file
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 10 days
  Maximum Volumes = 2
  # 160 GB corrispondono a 148x1024x1024x1024
  # Maximum Volume Bytes = 148G
  Maximum Volume Bytes = 160GB

# Per il Copy Job
  Storage = backup_mydomain_it-File
  NextPool = backup_mydomain_it_drive1
}

Pool {
  Name = backup_mydomain_it_drive1
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 30 days
# Per il Copy Job
  Storage = backup_mydomain_it-Drive-1
}

Pool {
  Name = backup_mydomain_it_drive2
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 30 days
}

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

####################################################
# Job di copia da disco a nastro del contenuto di  #
# un job. Non e' necessario ricontattare il client #
####################################################

#
# Fake fileset for copy jobs
#
Fileset {
  Name = None
  Include {
    Options {
      signature = MD5
    }
  }
}

#
# Fake client for copy jobs
#
Client {
  Name = None
  Catalog = MyCatalog
}

#
# Default template for a CopyDiskToTape Job
#
JobDefs {
  Name = CopyDiskToTape
  Type = Copy
  Messages = Standard
  Selection Type = PoolUncopiedJobs
  Maximum Concurrent Jobs = 10
  SpoolData = No
  Allow Duplicate Jobs = Yes
  Allow Higher Duplicates = No
  Cancel Queued Duplicates = No
  Cancel Running Duplicates = No
  Priority = 10
}

Schedule {
  Name = CopyDiskToTapeSchedule
  #Run = mon-fri at 8:30
  Run = mon-fri at 08:52
}

Schedule {
  Name = bacula-sd1_CopyDiskToTapeSchedule
  #Run = mon-fri at 8:30
  Run = mon-fri at 08:52
}

Job {
  Name = CopyDiskToTapeJob
  Client = None
  FileSet = None
  Enabled = Yes
  Schedule = CopyDiskToTapeSchedule
  Pool = backup_mydomain_it_file
  JobDefs = CopyDiskToTape
}

Job {
  Name = bacula-sd1_CopyDiskToTapeJob
  Client = None
  FileSet = None
  Enabled = Yes
  Schedule = bacula-sd1_CopyDiskToTapeSchedule
  Pool = bacula_sd1_mydomain_it_file
  JobDefs = CopyDiskToTape
}

