#BACULA DIR FILE
#
Director {
        Name = tokyo-dir
        DIRport = 9101
        QueryFile = "/usr/local/share/bacula/query.sql"
        WorkingDirectory = "/var/db/bacula"
        PidDirectory = "/var/run"
        Maximum Concurrent Jobs = 5
        Password = "22vu22"
        Messages = Daemon
}

Console {
        Name = tokyo-mon
        Password = "22vu22"
        CommandACL = status, .status
}

#DEFAULTS FOR JOBS, FILESETS, POOLS, AND SCHEDULES----------------------------

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Schedule = "WeeklyCycle"
  Storage = computerking.ca-localfile
  Fileset = DefaultFileSet
  Messages = Standard
  Pool = DefaultPool
  Full Backup Pool = Full-Pool
  Incremental Backup Pool = Inc-Pool
  Differential Backup Pool = Diff-Pool
  Priority = 10
#        Level = Incremental
#        Schedule = "MonthlyCycle"
}

Storage {
        Name = computerking.ca-localfile
        Address = tokyo.computerking.ca
        SDPort = 9103
        Password = "22vu22"
        Device = computerking.ca-localfile
        Media Type = File
}

FileSet {
  Name = "DefaultFileSet"
  Include {
    Options {
      signature = MD5
      compression = GZIP
}
    File = /
}
 Exclude {
    File = /proc
    File = /tmp
    File = /temp
    File = /.journal
    File = /.fsck
  }
}

Pool {
  Name = DefaultPool
  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
}

Pool {
  Name = Full-Pool
  Volume Retention = 3 months
  Maximum Volume Jobs = 1
  Label Format = Full-
  Maximum Volumes = 3
#  How do i include these in default pools  PoolDefs ?
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Accept Any Volume = yes
}

Pool {
  Name = Diff-Pool
  Volume Retention = 35 days
  Maximum Volume Jobs = 1
  Label Format = Diff-
  Maximum Volumes = 6
#  These are included in default pools?
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Accept Any Volume = yes
}

Pool {
  Name = Inc-Pool
  Volume Retention = 10 days
  Maximum Volume Jobs = 6
  Label Format = Inc-
  Maximum Volumes = 5
#  These are included in default pools?
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Accept Any Volume = yes
}

#  differential (i.e. incremental since full) every other sunday,
#  and incremental backups other days
Schedule {
  Name = "WeeklyCycle"
  Run = Full 1st sun at 02:05
  Run = Differential 2nd-5th sun at 02:05
  Run = Incremental mon-sat at 02:05
}
# Might be cool for remote shoemasters.com and the like
#Schedule {
#  Name = "MonthlyCycle"
#  Run = Level=Full-Pool = Monthly 1st sun at 2:05
#  Run = Level=Dif-Pool = 2nd-5th sun at 2:05
#  Run = Level=Inc-Pool = Daily mon-sat at 2:05
#}


#MY JOBS ##########################################################################-

Job {
  Name = "computerking.ca"
  JobDefs = "DefaultJob"
  Client = computerking.ca
  Fileset = computerking.ca
  Storage = computerking.ca
#  Covered in jobdef Pool = computerking.ca
  Write Bootstrap = "/var/db/bacula/tokyo-catalog.bsr"
}

Client {
  Name = computerking.ca
  Address = tokyo.computerking.ca
  FDPort = 9102
  Catalog = MyCatalog
  Password = "22vu22"
  File Retention = 60 days
  Job Retention = 6 months
  AutoPrune = yes
}

FileSet {
  Name = "computerking.ca"
  Include {
    Options {
      signature = MD5
      compression = GZIP6
}
    File = /
    File = /var
    File = /usr
    File = /home
}
 Exclude {
    File = /proc
    File = /tmp
    File = /.journal
    File = /.fsck
    File = /usr/src
    File = /usr/ports
    File = /usr/obj
    File = /usr/tmp
    File = /usr/local/share/export
    File = /home/backups/bacula
    File = /home/backups/tokyo.computerking.ca
    File = /home/stewartr
    File = /home/ftpking
   }
}
Storage {
        Name = computerking.ca
        Address = tokyo.computerking.ca
        SDPort = 9103
        Password = "22vu22"
        Device = computerking.ca
        Media Type = computerking.ca
}

#Pool {
#  Name = computerking.ca
#  Use Volume Once = yes
#  Pool Type = Backup
#  LabelFormat = "computerking.ca-"
#  AutoPrune = yes
#  VolumeRetention = 1 month
#  Maximum Volume Bytes = 671088640
#  Recycle = yes
#}

# shoemasters.com =============================================================
# shoemastes.com the main mail server

Job {
  Name = "shoemasters.com"
  JobDefs = "DefaultJob"
  Type = Backup
  Client = shoemasters.com
  Fileset = shoemasters.com
  Storage = shoemasters.com
# override schedule from jobdef to savebandwidth
#  Schedule = MonthlyCycle

  Write Bootstrap = "/var/db/bacula/shoemasters.com.bsr"
# ClientRunBeforeJob = "/opt/zimbra/zimbra_hot_backupf.sh"
#  ClientRunBeforeJob = "/opt/zimbra/bin/zimbra stop"
#  ClientRunAfterJob = "/opt/zimbra/bin/zimbra start"
# ClientRunBeforeJob = "/opt/zimbra/zimbrastop.scr"
# ClientRunAfterJob = "/opt/zimbra/zimbrastart.scr"
}

# Client (File Services) to backup
Client {
  Name = shoemasters.com
  Address = shoemasters.com
  FDPort = 9102
  Catalog = MyCatalog
  Password = "22vu22"          # password for FileD
  AutoPrune = yes                     # Prune expired Jobs/Files
}

FileSet {
Name = "shoemasters.com"
Include {
Options {
      signature = MD5
      compression = GZIP
}
        File = /
}

Exclude {
        File = /tmp
	File = /lost+found
	File = /opt
	}
}

Storage {
        Name = shoemasters.com
        Address = tokyo.computerking.ca
        SDPort = 9103
        Password = "22vu22"
        Device = shoemasters.com
        Media Type = shoemasters.com
}

#Pool {
#  Name = shoemasters.com
#  Use Volume Once = yes
#  Pool Type = Backup
#  LabelFormat = "shoemasters.com-"
#  AutoPrune = yes
#  VolumeRetention = 1 month
#  Maximum Volume Bytes = 671088640
#  Recycle = yes
#}

#CATALOG #####################################################################################

Catalog {
  Name = MyCatalog
  dbname = bacula; user = bacula; password = ""
}

# Backup the catalog database (after the nightly save)
Job {
  Name = "BackupCatalog"
  JobDefs = "DefaultJob"
  Level = Full
  Client = computerking.ca-catalog
  FileSet="computerking.ca-catalog"
  Pool= computerking.ca-catalog
  Schedule = "WeeklyCycleAfterBackup"
  Storage = computerking.ca-catalog
  # This creates an ASCII copy of the catalog
  RunBeforeJob = "/usr/local/share/bacula/make_catalog_backup bacula bacula"
  # This deletes the copy of the catalog
  RunAfterJob  = "/usr/local/share/bacula/delete_catalog_backup"
  Write Bootstrap = "/var/db/bacula/BackupCatalog.bsr"
  Priority = 11                   # run after main backup
}

Client {
  Name = computerking.ca-catalog
  Address = tokyo.computerking.ca
  FDPort = 9102
  Catalog = MyCatalog
  Password = "22vu22"          # password for FileD
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}

# This is the backup of the catalog
FileSet {
  Name = "computerking.ca-catalog"
  Include {
    Options {
      signature = MD5
    }
    File = /var/db/bacula/bacula.sql
  }
}

Pool {
  Name = computerking.ca-catalog
  Use Volume Once = yes
  Pool Type = Backup
  LabelFormat = "computerking.ca-catalog-"
  AutoPrune = yes
  VolumeRetention = 1 month
  Maximum Volume Bytes = 134217728
  Recycle = yes
}

Schedule {
  Name = "WeeklyCycleAfterBackup"
  Run = Full sun-sat at 2:10
}

Storage {
        Name = computerking.ca-catalog
        Address = tokyo.computerking.ca
        SDPort = 9103
        Password = "22vu22"
        Device = computerking.ca-storage
        Media Type = computerking.ca-storage
}

#Job {
#  Name = "tokyo-job"
#  JobDefs = "DefaultJob"
#  Write Bootstrap = "/var/db/bacula/tokyo-catalog.bsr"
#  FileSet = tokyo-catalog
#  Client = tokyo-fd
#}

#MESSAGES ######################################################################################

# Message delivery for daemon messages (no job).
Messages {
        Name = Daemon
        mailcommand = "/usr/local/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
        mailcommand = "mail -s test luck@computerking.ca"
        Mail = luck@computerking.ca = all
        console = all
        append = "/var/db/bacula/log" = all
}

Messages {
  Name = Standard
  mailcommand = "/usr/local/sbin/bsmtp -h mx1.computerking.ca -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/local/sbin/bsmtp -h mx1.computerking.ca -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
  MailOnError = luck@computerking.ca = all, !skipped, !terminate
  append = "/var/db/bacula/log" = all, !skipped, !terminate
  operator = luck@computerking.ca = mount
  console = all, !skipped, !saved
}

#RESTORE JOBS -----------------------------------------------------------------
# Standard Restore template, to be changed by Console program
Job {
  Name = "RestoreFiles"
  Type = Restore
  Client= computerking.ca-restore
  FileSet="computerking.ca"
  Storage = computerking.ca-localfile
  Pool = DefaultPool
  Messages = Standard
  Where = /home/bacula-restores
}

Client {
  Name = computerking.ca-restore
  Address = tokyo.computerking.ca
  FDPort = 9102
  Catalog = MyCatalog
  Password = "22vu22"          # password for FileD
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}


#reset the database
#
# cd <install-directory>
#  /usr/local/share/bacula/drop_mysql_tables
#  /usr/local/share/bacula/make_mysql_tables
#

