# BACULA DIR FILE

Director {                            # define myself
  Name = backup1-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/usr/local/share/bacula/query.sql"
  WorkingDirectory = "/var/db/bacula"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = "c0mputerking-c0ns0le"         # Console password
  Messages = Daemon
}

Console {
  Name = backup1-mon
  Password = "c0mputerking-m0nit0r"
  CommandACL = status, .status
}

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

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

Storage {
  Name = File
#  Address = 127.0.0.1                # N.B. Use a fully qualified name here
  Address = new.computerking.ca              # be very careful here
  SDPort = 9103
  Password = "c0mputerking-st0rage"
  Device = FileStorage
  Media Type = File
}

Storage {
  Name = ck
  Address = 127.0.0.1                # N.B. Use a fully qualified name here
#  Address = 192.168.0.23              # be very careful here
  SDPort = 9103
  Password = "c0mputerking-st0rage"
  Device = ck
  Media Type = ck
}

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

Schedule {
  Name = "ckcycle"
  Run = Level=Full on 1 at 05:05
  Run = Level=Incremental on 2-31 at 05:05
}


Pool {
  Name = ckpool
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Retention = 35 days         # one year
}

Pool {
  Name = Default
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Retention = 365 days         # one year
}

# FILE SETS -------------------------------------------------------------------

FileSet {
  Name = "Full Set Unix"
  Include {
    Options {
     signature = MD5
     Compression=GZIP
    }
        File = /
        File = /var
        File = /usr
  }
  Exclude {
    File = /proc
    File = /tmp
    File = /.journal
    File = /.fsck
 # so as not to backup backups being backed up hehe
    File = /usr/local/bacula
 }
}

FileSet {
 Name = "WINXPRO"
# enableevss = yes
 Include {
  Options {
   signature = MD5
   Compression=GZIP
   portable = no
   Exclude = yes
   IgnoreCase = yes
   # Exclude Mozilla-based programs' file caches
   WildDir = "[A-Z]:/Documents and Settings/*/Application 
Data/*/Profiles/*/*/Cache"
   WildDir = "[A-Z]:/Documents and Settings/*/Application 
Data/*/Profiles/*/*/Cache.Trash"
   WildDir = "[A-Z]:/Documents and Settings/*/Application
Data/*/Profiles/*/*/ImapMail"

   # Exclude user's registry files - they're always in use anyway.
   WildFile = "[A-Z]:/Documents and Settings/*/Local Settings/Application
Data/Microsoft/Windows/usrclass.*"
   WildFile = "[A-Z]:/Documents and Settings/*/ntuser.*"

   # Exclude directories full of lots and lots of useless little files
   WildDir = "[A-Z]:/Documents and Settings/*/Cookies"
   WildDir = "[A-Z]:/Documents and Settings/*/Recent"
   WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/History"
   WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/Temp"
   WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/Temporary
Internet Files"

   # These are always open and unable to be backed up
   WildFile = "[A-Z]:/Documents and Settings/All Users/ApplicationData/Microsoft/Network/Downloader/qmgr[01].dat"

   # Some random bits of Windows we want to ignore
   WildFile = "[A-Z]:/WINXPRO/security/logs/scepol.log"
   WildDir = "[A-Z]:/WINXPRO/system32/config"
   WildDir = "[A-Z]:/WINXPRO/msdownld.tmp"
   WildDir = "[A-Z]:/WINXPRO/Internet Logs"
   WildDir = "[A-Z]:/WINXPRO/$Nt*Uninstall*"
   WildDir = "[A-Z]:/WINXPRO/sysvol"
   WildFile = "[A-Z]:/WINXPRO/cluster/CLUSDB"
   WildFile = "[A-Z]:/WINXPRO/cluster/CLUSDB.LOG"
   WildFile = "[A-Z]:/WINXPRO/NTDS/edb.log"
   WildFile = "[A-Z]:/WINXPRO/NTDS/ntds.dit"
   WildFile = "[A-Z]:/WINXPRO/NTDS/temp.edb"
   WildFile = "[A-Z]:/WINXPRO/ntfrs/jet/log/edb.log"
   WildFile = "[A-Z]:/WINXPRO/ntfrs/jet/ntfrs.jdb"
   WildFile = "[A-Z]:/WINXPRO/ntfrs/jet/temp/tmp.edb"
   WildFile = "[A-Z]:/WINXPRO/system32/CPL.CFG"
   WildFile = "[A-Z]:/WINXPRO/system32/dhcp/dhcp.mdb"
   WildFile = "[A-Z]:/WINXPRO/system32/dhcp/j50.log"
   WildFile = "[A-Z]:/WINXPRO/system32/dhcp/tmp.edb"
   WildFile = "[A-Z]:/WINXPRO/system32/LServer/edb.log"
   WildFile = "[A-Z]:/WINXPRO/system32/LServer/TLSLic.edb"
   WildFile = "[A-Z]:/WINXPRO/system32/LServer/tmp.edb"
   WildFile = "[A-Z]:/WINXPRO/system32/wins/j50.log"
   WildFile = "[A-Z]:/WINXPRO/system32/wins/wins.mdb"
   WildFile = "[A-Z]:/WINXPRO/system32/wins/winstmp.mdb"

   # Temporary directories & files
   WildDir = "[A-Z]:/WINXPRO/Temp"
   WildDir = "[A-Z]:/temp"
   WildFile = "*.tmp"
   WildDir = "[A-Z]:/tmp"
   WildDir = "[A-Z]:/var/tmp"

   # Recycle bins
   WildDir = "[A-Z]:/RECYCLER"

   # Swap files
   WildFile = "[A-Z]:/pagefile.sys"

   # These are programs and are easier to reinstall than restore from
   # backup
   WildDir = "[A-Z]:/cygwin"
   WildDir = "[A-Z]:/Program Files/Grisoft"
   WildDir = "[A-Z]:/Program Files/Java"
   WildDir = "[A-Z]:/Program Files/Java Web Start"
   WildDir = "[A-Z]:/Program Files/JavaSoft"
   WildDir = "[A-Z]:/Program Files/Microsoft Office"
   WildDir = "[A-Z]:/Program Files/Mozilla Firefox"
   WildDir = "[A-Z]:/Program Files/Mozilla Thunderbird"
   WildDir = "[A-Z]:/Program Files/mozilla.org"
   WildDir = "[A-Z]:/Program Files/OpenOffice*"
 

# My stuff
        WildDir = "[A-Z]:*/1_NOBACKUP"
        WildDir = "[A-Z]:/Documents and Settings/King/Application Data/Skype"
}

  # Our Win2k boxen all have C: and D: as the main hard drives.
  File = "C:/"
  File = "D:/"
 }
}

FileSet {
 Name = "Rescue Freesbie WINXPRO"
 Include {
  Options {
   signature = MD5
   Compression=GZIP
   portable = no
   Exclude = yes
   IgnoreCase = yes
   # Exclude Mozilla-based programs' file caches
   WildDir = "[A-Z]:/Documents and Settings/*/Application
Data/*/Profiles/*/*/Cache"
   WildDir = "[A-Z]:/Documents and Settings/*/Application
Data/*/Profiles/*/*/Cache.Trash"
   WildDir = "[A-Z]:/Documents and Settings/*/Application
Data/*/Profiles/*/*/ImapMail"

   # Exclude user's registry files - they're always in use anyway.
#   WildFile = "[A-Z]:/Documents and Settings/*/Local Settings/ApplicationData/Microsoft/Windows/usrclass.*"
#   WildFile = "[A-Z]:/Documents and Settings/*/ntuser.*"

   # Exclude directories full of lots and lots of useless little files
   WildDir = "[A-Z]:/Documents and Settings/*/Cookies"
   WildDir = "[A-Z]:/Documents and Settings/*/Recent"
   WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/History"
   WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/Temp"
   WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/TemporaryInternet Files"

   # These are always open and unable to be backed up
   WildFile = "[A-Z]:/Documents and Settings/All Users/ApplicationData/Microsoft/Network/Downloader/qmgr[01].dat"

# Some random bits of Windows we want to ignore
   WildFile = "[A-Z]:/WINXPRO/security/logs/scepol.log"
   WildDir = "[A-Z]:/WINXPRO/system32/config"
   WildDir = "[A-Z]:/WINXPRO/msdownld.tmp"
   WildDir = "[A-Z]:/WINXPRO/Internet Logs"
   WildDir = "[A-Z]:/WINXPRO/$Nt*Uninstall*"
   WildDir = "[A-Z]:/WINXPRO/sysvol"
   WildFile = "[A-Z]:/WINXPRO/cluster/CLUSDB"
   WildFile = "[A-Z]:/WINXPRO/cluster/CLUSDB.LOG"
   WildFile = "[A-Z]:/WINXPRO/NTDS/edb.log"
   WildFile = "[A-Z]:/WINXPRO/NTDS/ntds.dit"
   WildFile = "[A-Z]:/WINXPRO/NTDS/temp.edb"
   WildFile = "[A-Z]:/WINXPRO/ntfrs/jet/log/edb.log"
   WildFile = "[A-Z]:/WINXPRO/ntfrs/jet/ntfrs.jdb"
   WildFile = "[A-Z]:/WINXPRO/ntfrs/jet/temp/tmp.edb"
   WildFile = "[A-Z]:/WINXPRO/system32/CPL.CFG"
   WildFile = "[A-Z]:/WINXPRO/system32/dhcp/dhcp.mdb"
   WildFile = "[A-Z]:/WINXPRO/system32/dhcp/j50.log"
   WildFile = "[A-Z]:/WINXPRO/system32/dhcp/tmp.edb"
   WildFile = "[A-Z]:/WINXPRO/system32/LServer/edb.log"
   WildFile = "[A-Z]:/WINXPRO/system32/LServer/TLSLic.edb"
   WildFile = "[A-Z]:/WINXPRO/system32/LServer/tmp.edb"
   WildFile = "[A-Z]:/WINXPRO/system32/wins/j50.log"
   WildFile = "[A-Z]:/WINXPRO/system32/wins/wins.mdb"
   WildFile = "[A-Z]:/WINXPRO/system32/wins/winstmp.mdb"

   # Temporary directories & files
   WildDir = "[A-Z]:/WINXPRO/Temp"
   WildDir = "[A-Z]:/temp"
   WildFile = "*.tmp"
   WildDir = "[A-Z]:/tmp"
   WildDir = "[A-Z]:/var/tmp"

   # Recycle bins
   WildDir = "[A-Z]:/RECYCLER"

   # Swap files
   WildFile = "[A-Z]:/pagefile.sys"

   # Hibernation files
   WildFile = "[A-Z]:/hiberfile.sys"

   # These are programs and are easier to reinstall than restore from
   # backup
   WildDir = "[A-Z]:/cygwin"
   WildDir = "[A-Z]:/Program Files/Grisoft"
   WildDir = "[A-Z]:/Program Files/Java"
   WildDir = "[A-Z]:/Program Files/Java Web Start"
   WildDir = "[A-Z]:/Program Files/JavaSoft"
   WildDir = "[A-Z]:/Program Files/Microsoft Office"
   WildDir = "[A-Z]:/Program Files/Mozilla Firefox"
   WildDir = "[A-Z]:/Program Files/Mozilla Thunderbird"
   WildDir = "[A-Z]:/Program Files/mozilla.org"
   WildDir = "[A-Z]:/Program Files/OpenOffice*"


# My stuff
        WildDir = "[A-Z]:*/1_NOBACKUP"
        WildDir = "[A-Z]:/Documents and Settings/King/Application Data/Skype"
}

  # Freesbie uses these
  File = "/mnt/ntfs.1"
  File = "/mnt/ntfs.2"
  File = "/mnt/ntfs.3"
  File = "/mnt/ntfs.4"
  File = "/mnt/ntfs.5"
  File = "/mnt/ntfs.6"
 }
}

# THIS IS THE DEFAULT JOB NEED TO BE HERE FOR RESTORE SHOULD BACKUP ITSELF BUT WHY?
# FOR NOW IT IS JUST MY HOME DIR DOES NOT CHANGE MUCH
# I think i get it now i will use this to backup the local system
# and to be used for restore jobs
# this should be setup for hendrick server soon for now i will do local i guess 

Job {
  Name = "Default"
  Client = "Default-fd"
  JobDefs = "DefaultJob"
  File Set = "Full Set Unix"
  Write Bootstrap = "/var/db/bacula/Default.bsr"
}

# Client (File Services) to backup
Client {
  Name = Default-fd
  Address = 127.0.0.1
  FDPort = 9102
  Catalog = MyCatalog
  Password = "c0mputerking-file"          # password for FileDaemon
  File Retention = 35 days            # 30 days
  Job Retention = 40 days            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}

# CATALOG =====================================================================

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

# 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 = "/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
}

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

FileSet {
  Name = "Catalog"
  Include {
    Options {
      signature = MD5
    }
    File = /var/db/bacula/bacula.sql
  }
}

# MESSAGES ====================================================================
# 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/local/sbin/bsmtp -h 127.0.0.1 -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/local/sbin/bsmtp -h 127.0.0.1 -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = king@computerking.ca = all, !skipped            
  operator = king@computerking.ca = 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/db/bacula/log" = all, !skipped
}

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

# RESTORE =====================================================================
# 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= Default-fd
  FileSet= "Full Set Unix"
  Storage = File
  Pool = Default
  Messages = Standard
  Where = /tmp/bacula-restores
}

# JOBS ========================================================================

#Job {
#  Name = "new.computerking.ca"
#  Client = new.computerking.ca-fd
#  JobDefs = "DefaultJob"
#  Write Bootstrap = "/var/db/bacula/new.computerking.bsr"
#}

#Client {
#  Name = new.computerking.ca-fd
#  Address = 192.168.0.12
#  FDPort = 9102
#  Catalog = MyCatalog
#  Password = "c0mputerking-file"         # password for FileDa
#  File Retention = 30 days            # 30 days
#  Job Retention = 6 months            # six months
#  AutoPrune = yes                     # Prune expired Jobs/Files
#}

Job {
  Name = "lappy"
  Client = lappy-fd
  JobDefs = "DefaultJob"
  Pool = ckpool
  Schedule = ckcycle
  Storage = ck
  Write Bootstrap = "/var/db/bacula/lappy.bsr"
}

Client {
  Name = lappy-fd
  Address = computerking.ca  #wireless card
#  Address = 192.168.0.11  #wired card
  FDPort = 9102
  Catalog = MyCatalog
  Password = "c0mputerking-file"         # password for FileDa
  File Retention = 35 days            # 30 days
  Job Retention = 40 days            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}

Job {
  Name = "i925"
  Client = i925-fd
  JobDefs = "DefaultJob"
  Pool = ckpool
  Schedule = ckcycle
  Storage = ck
  File Set = "WINXPRO"
  Write Bootstrap = "/var/db/bacula/i925.bsr"
}

Client {
  Name = i925-fd
  Address = 192.168.0.10
  FDPort = 9102
  Catalog = MyCatalog
  Password = "c0mputerking-file"         # password for FileDa
  File Retention = 35 days            # 30 days
  Job Retention = 40 days            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
#  Pool = ckpool
#  Schedule = ckcycle
}

# RESCUE JOB -----
# eventually add cd dvd support

Job {
  Name = "rescue"
  Client = "rescue-fd"
  JobDefs = "DefaultJob"
  File Set = "Rescue Freesbie WINXPRO"
  Write Bootstrap = "/var/db/bacula/rescue.bsr"
  Level = "Full"
  Schedule = "rescue"
  Storage = "rescue"
  Pool = "rescue"
  Priority = "9"
}

Client {
  Name = "rescue-fd"
  Address = "192.168.0.20"
  FDPort = "9102"
  Catalog = "MyCatalog"
  Password = "c0mputerking-file"
  File Retention = 7d
  Job Retention = 14d
  AutoPrune = "yes"
}

Storage {
  Name = rescue
  Address = 127.0.0.1                # N.B. Use a fully qualified name here
#  Address = 192.168.0.23              # be very careful here
  SDPort = 9103
  Password = "c0mputerking-st0rage"
  Device = rescue
  Media Type = rescue
}

Pool {
  Name = "rescue"
  Use Volume Once = "yes"
  Pool Type = "Backup"
  LabelFormat = "rescue-"
  Volume Retention = 7d
  Maximum Volumes = "10"
  Recycle = "yes"
}

# This will run 1st of every month until i find a one time only option as i will be running manually
Schedule {
  Name = "rescue"
  Run = Full 1st sun at 23:05
}


# MISC ========================================================================
#reset the database
#
# cd <install-directory>
#  /usr/local/share/bacula/drop_mysql_tables
#  /usr/local/share/bacula/make_mysql_tables
#
#compact the database
#mysqldump -f --opt bacula > bacula.sql
#mysql bacula < bacula.sql
#rm -f bacula.sql

