#
# 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 2.4.4 (28 December 2008) -- suse 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.
#



# Filesets for backup of ESX VMs via vcb

Director {                            # define myself
  # test
  Name = bacula-dir
  DirAddresses  = {
    ip = { addr = 127.0.0.1; port = 9101 }
    ip = { addr = 10.20.40.211; port = 9101 }
    }
#  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/usr/lib64/bacula/query.sql"
  WorkingDirectory = "/var/lib/bacula"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 10
  Password = "0DntXXl7DVkNYYRApYdhKKoy2Huq1CVHwIRAKUwgNA86"         # Console password
  Messages = Daemon
}

  

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

JobDefs {
  Name = "ServerJob"
  Type = Backup
  Level = Incremental
  Client = bacula-fd
  FileSet = "Full Set"
  Schedule = "WeeklyCycle"
  Storage = FileStorage
  Messages = Standard
  Pool = FileStoragePool
  Priority = 10
}


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

#Job {
#  Name = "Client2"
#  Client = bacula2-fd
#  JobDefs = "DefaultJob"
#  Write Bootstrap = "/var/lib/bacula/Client2.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
  # 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>
  RunBeforeJob = "/usr/lib64/bacula/make_catalog_backup bacula bacula"
  # This deletes the copy of the catalog
  RunAfterJob  = "/usr/lib64/bacula/delete_catalog_backup"
  Write Bootstrap = "/var/lib/bacula/BackupCatalog.bsr"
  Priority = 11                   # run after main backup
}

#
# Standard Restore template, to be changed by Console program
#  Only one such job is needed for all Jobs/Clients/Storage ...
#
Job {
  Name = "RestoreFiles"
  Type = Restore
  Client=bacula-fd                 
  FileSet="Full Set"                  
  Storage = FileStorage
  Pool = FileStoragePool
  Messages = Standard
  Where = /bacula-restores
  Client Run After Job = "\"C:/Programme/VMware/VMware Consolidated Backup Framework/vcbRestore.exe\" -h localhost -u dassit -p linuxlinux -s c:\\backups\\xp_mini"

}


# 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 partitons such as /usr or /home
#    you will probably want to add them too.
#
#  By default this is defined to point to the Bacula build
#    directory to give a reasonable FileSet to backup to
#    disk storage during initial testing.
#
#    File = /usr/src/packages/BUILD/bacula-2.4.4
#  }

#
# 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
}

# This schedule does the catalog. It starts after the WeeklyCycle
Schedule {
  Name = "WeeklyCycleAfterBackup"
  Run = Full sun-sat at 23:10
}



Schedule {
  Name = "Never"
}

Schedule {
  Name = "DassITCycle"
  Run = Level=Full          Pool=FileStoragePool Storage=FileStorage 1st fri at 21:07
  Run = Level=Full          Pool=FileStoragePool Storage=FileStorage 2nd-5th fri at 21:45
  Run = Level=Incremental   Pool=FileStoragePool Storage=FileStorage mon-fri at 00:07
}

Schedule {
  Name = "LaptopCycle"
  Run = Level=Full          Pool=FileStoragePool Storage=FileStorage 1st fri at 10:30
  Run = Level=Differential  Pool=FileStoragePool Storage=FileStorage 2nd-5th fri at 12:00pm
  Run = Level=Incremental   Pool=FileStoragePool Storage=FileStorage mon-fri at 12:30pm
}

# www server backup durchführen
Schedule {
  Name = "www-cycle"
  Run = Level=Full         Pool=FileStoragePool Storage=FileStorage 1st fri at 19:00
  Run = Level=Full         Pool=FileStoragePool Storage=FileStorage 2nd-5th fri at 19:00
  Run = Level=Incremental  Pool=FileStoragePool Storage=FileStorage mon-fri at 23:30
}

Schedule {
  Name = "ManuelaCycle"
  Run = Level=Full          Pool=FileStoragePool Storage=FileStorage 1st thu at 10:30
  Run = Level=Differential  Pool=FileStoragePool Storage=FileStorage 2nd-5th thu at 12:00pm
  Run = Level=Incremental   Pool=FileStoragePool Storage=FileStorage mon,thu at 12:30pm
}


Schedule {
  Name = "migrationcycle"
  Run = Level=Full          Pool=FileStoragePool Storage=FileStorage fri at 21:00
}


# Sicherung der Produktivmaschinen über VCB, 1. Samstag im Monat um 3:00
Schedule {
  Name = "vcb-cycle"
  Run = Level=Full          Pool=FileStoragePool Storage=FileStorage 1st sat at 03:00
}

# Sicherung der Produktivmaschinen über VCB, 2. Samstag im Monat um 3:00
Schedule {
  Name = "vcb-cycle-migrate"
  Run = Level=Full          Pool=FileStoragePool Storage=FileStorage 2nd sat at 03:00
}

Catalog{
	Name = MyCatalog
        dbname = "bacula"; dbuser = "bacula"; dbpassword = ""
}

Catalog{
        Name = MyOtherCatalog
        dbname = "bacula"; 
	dbuser = "bacula"; 
	dbpassword = ""
}

Catalog{
        Name = YetAnotherCatalog
        dbname = "bacula"; 
	dbuser = "bacula"; 
	dbpassword = ""
}

Catalog{
        Name = MyCompletelyNewCatalog
        dbname = "bacula"; 
	dbuser = "bacula"; 
	dbpassword = ""
}




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

Client {
  Name = cryptoserver-fd
  Address = cryptoserver
  FDPort = 9102
  Catalog = MyCatalog
}

Client {
  Name = gaffel-fd
  Address = gaffel
  FDPort = 9102
  Catalog = MyCatalog
  Password = "3f580b8811dc920c0c34d060fe9e7f2d"          # password for FileDaemon
}


# 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 = "/etc/bacula/make_catalog_backup bacula bacula"
#  # This deletes the copy of the catalog
#  RunAfterJob  = "/etc/bacula/delete_catalog_backup"
#  Write Bootstrap = "/var/lib/bacula/BackupCatalog.bsr"
#  Priority = 11                   # run after main backup
#  Client = bacula-fd
#}


## Backup the InterIura  servers
#Job {
#  Name = "iu-vtiger"
#  JobDefs = "ServerJob"
#  # This creates an ASCII copy of the catalog
#  Client Run Before Job = "/usr/local/bin/dump_db vtigercrm503 root vtiger"
#  # This deletes the copy of the catalog
#  Client Run After Job  = "/usr/local/bin/delete_db_dump"
#  Write Bootstrap = "/var/lib/bacula/iu-vtiger.bsr"
#  Client = iu-vtiger-fd
#  FileSet = "iu-set"
#}

## Backup the InterIura  servers
#Job {
#  Name = "iu-wiki"
#  JobDefs = "ServerJob"
#  # This creates an ASCII copy of the catalog
#  Client RunBeforeJob = "/usr/local/bin/dump_db wikidb root InterIura512"
#  # This deletes the copy of the catalog
#  Client RunAfterJob  = "/usr/local/bin/delete_db_dump"
#  Write Bootstrap = "/var/lib/bacula/iu-wiki.bsr"
#  Client = iu-wiki-fd
#  FileSet = "iu-set"
#}




#
# Define the main nightly save backup job
Job {
  Name = "bacula"
  JobDefs = "ServerJob"
  Write Bootstrap = "/var/lib/bacula/bacula.bsr"
  FileSet = "Full Set"
  Client = bacula-fd
#  Spool Data = yes
}

Job {
  Name = "ox6"
  JobDefs = "ServerJob"
  Description = "ox backup"
  Write Bootstrap = "/var/lib/bacula/ox.bsr"
  FileSet = "ox set"
  Client = ox6-fd
#  Spool Data = yes
  Client Run Before Job = "/usr/local/bin/mysqldump-all.sh"
# Client Run Before Job = "/home/plone/dassIT/bin/repozo  -BvzQ -r /home/plone/dassIT/backup/ -f    /home/plone/dassIT/var/filestorage/Data.fs"
}

Job {
  Name = "gemeinschaft"
  JobDefs = "ServerJob"
  Description = " backup"
  Write Bootstrap = "/var/lib/bacula/gemeinschaft.bsr"
  FileSet = "gemeinschaft set"
  Client = gemeinschaft-fd
#  Spool Data = yes
  Client Run Before Job = "/usr/local/bin/dump_mysqldb.sh"
# Client Run Before Job = "/home/plone/dassIT/bin/repozo  -BvzQ -r /home/plone/dassIT/backup/ -f    /home/plone/dassIT/var/filestorage/Data.fs"
}

Job {
  FileSet = "sfriedelfileset"
  Name = "sfriedel"
  Client = sfriedel-fd
  JobDefs = "LaptopJob"
  Write Bootstrap = "/var/lib/bacula/sfriedel.bsr"
  Enabled = no
}

## Laptop Sebastian Lederer
Job {
  FileSet = "sledererfileset"
  Name = "slederer"
  Client = slederer-fd
  JobDefs = "LaptopJob"
  Write Bootstrap = "/var/lib/bacula/slederer.bsr"
}


## Laptop Torsten
Job {
  FileSet = "torstenfileset"
  Name = "torsten"
  Client = torsten-fd
  JobDefs = "TorstenJob"
  Write Bootstrap = "/var/lib/bacula/torsten.bsr"
}


Job {
  Name = "futurama"
  Client = futurama-fd
  JobDefs = "ServerJob"
  FileSet = "futurama set"
  Write Bootstrap = "/var/lib/bacula/futurama.bsr"
  Client Run Before Job = "/usr/local/bin/backup_database.sh 'buerokratiewikidb wikidb' /var/tmp/db_backup"
}

Job {
  Name = "database1-dbs"
  JobDefs = "ServerJob"
  Level = Full
  FileSet="database1 set dbs"
  Client = database1-fd  
  # This creates a backup of the databases with pg_dump to fifos
  Client Run Before Job = "/etc/bacula/prepare_postgres_backup.sh"
  # This deletes the backup and fifo files
  Client Run After Job  = "/etc/bacula/cleanup_postgres_backup.sh"
  Priority = 17                   # run after main backup
}

Job {
  Name = "virtualcenter"
  Client = "virtualcenter-fd"
  JobDefs = "ServerJob"
  FileSet = "win2k3-fileset"
  Write Bootstrap = "/var/lib/bacula/virtualcenter.bsr"
}

Job {
  Name = "vcbproxy"
  Client = "vcbproxy-fd"
  JobDefs = "ServerJob"
  FileSet = "vcbproxy-fileset"
  Storage = TandbergT40
  enabled = no
  Write Bootstrap = "/var/lib/bacula/vcbproxy.bsr"
}

Job {
  Name = "Archive"
  Client = "trac-fd"
  JobDefs = "Archive Job"
  FileSet = "Archive Set"
  Write Bootstrap = "/var/lib/bacula/archive.bsr"
}

