#
# 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.38.9 (02 May 2006) -- gentoo 1.12.0_pre16
#
#  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 = idefix 
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/usr/libexec/bacula/query.sql"
  WorkingDirectory = "/var/lib/bacula"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 4 
  Password = "some password"
  Messages = Daemon
}


JobDefs {
	Name = "Full"
	Type = "Backup"
	Schedule = "Full"
	Messages = Standard
	Level = Full
	Priority = 9 
}

JobDefs {
	Name = "Incremental"
	Type = "Backup"
	Schedule = "Incremental"
	Messages = Standard
	Pool = Incremental
	Level = Incremental
	Priority = 9
	Storage = DLT-1
}

Job {
  Name = "Restore Dogmatix"
  Type = Restore
  Client= dogmatix                 
  FileSet = "Dogmatix File Set"                  
  Messages = Standard
  Where = /tmp/bacula-restores/dogmatix/
  Storage = DLT-3
  Bootstrap = /var/lib/bacula/bsr/dogmatix.bsr
  Pool = Dogmatix
}

Job {
  Name = "Restore Obelix"
  Type = Restore
  Client= obelix
  FileSet="Obelix File Set"
  Messages = Standard
  Where = /tmp/	bacula-restores/obelix/
  Storage = DLT-2
  Bootstrap = /var/lib/bacula/bsr/obelix.bsr
  Pool = Obelix 
}


Job {
  Name = "Full Dogmatix"
  FileSet = "Dogmatix File Set"
  Client = dogmatix
  JobDefs = "Full"
  Write Bootstrap = "/var/lib/bacula/bsr/dogmatix.bsr" 
  ClientRunBeforeJob = "/bin/echo test >/tmp/test;/usr/bin/mysqladmin flush-tables"
  Max Start Delay = 10h
  Storage = DLT-3
  Pool = Dogmatix
#  RunScript {
#    RunsOnClient = Yes
#    RunsWhen = Before
#    Command = "/usr/bin/mysqladmin flush-tables"
#  }
} 

Job {
 Name = "Full Obelix"
  FileSet = "Obelix File Set"
  Client = obelix
  JobDefs= "Full" 
  Write Bootstrap = "/var/lib/bacula/bsr/obelix.bsr"
  ClientRunBeforeJob = "/bin/echo test >/tmp/test;/usr/bin/mysqladmin flush-tables"
  Max Start Delay = 10h
  Storage = DLT-2
  Pool = Obelix
#  RunScript {
#	RunsOnClient = Yes
#	RunsWhen = Before
#	Command = "/usr/bin/mysqladmin flush-tables"
#  }
}

Job {
  Name = "Incremental Dogmatix"
  FileSet = "Dogmatix File Set"
  Client = dogmatix
  JobDefs = "Incremental"
  Write Bootstrap = "/var/lib/bacula/bsr/dogmatix-inc.bsr"
  ClientRunBeforeJob = "/bin/echo test >/tmp/test;/usr/bin/mysqladmin flush-tables"
  Max Start Delay = 10h
  Spool Data = yes
#  RunScript {
#      RunsOnClient = Yes
#      RunsWhen = Before
#      Command = "/usr/bin/mysqladmin flush-tables"
#   }
}

Job {
  Name = "Incremental Obelix"
  FileSet = "Obelix File Set"
  Client = obelix
  JobDefs = "Incremental"
  Write Bootstrap = "/var/lib/bacula/bsr/obelix-inc.bsr"
  ClientRunBeforeJob = "/bin/echo test >/tmp/test;/usr/bin/mysqladmin flush-tables"
  Max Start Delay = 10h
  Spool Data = yes
#  RunScript {
#      RunsOnClient = Yes
#      RunsWhen = Before
#      Command = "/usr/bin/mysqladmin flush-tables"
#   }
}

#dogmatix
FileSet {
   Name = "Dogmatix File Set"
	   Include {
   		Options {
      		  recurse = yes
        	  signature = SHA1
	   		}
	
		# File = <dogmatix-files
		File = </etc/bacula/dogmatix-files
	   }	  
       
       Exclude {

		# File = <dogmatix-x-files
	        File = </etc/bacula/dogmatix-x-files 
	   }
}

#obelix
FileSet {
	   Name = "Obelix File Set"
        Include {
             Options {
                signature = SHA1
		recurse = yes
             }

            File = </etc/bacula/obelix-files
        }

        Exclude {
	        
	    File = </etc/bacula/obelix-x-files
	}
}

Schedule {
	Name  = "Full"

	Run = mon  at 22:30
}

Schedule {
        Name  = "Incremental"

        Run = SpoolData=yes tue-sun at 22:30

}

# Client (File Services) to backup
Client {
  Name = dogmatix
  Address = dogmatix
  FDPort = 9102
  Catalog = MyCatalog
  Password = "some password"
  File Retention = 30 days            # 30 days
  Job Retention = 6 months            # six months
  AutoPrune = yes                     # Prune expired Jobs/Files
}

Client {
  Name = obelix
  Address = obelix
  FDPort = 9102
  Catalog = MyCatalog
  Password = "some password"
  File Retention = 30 days
  Job Retention = 6 months
  AutoPrune = yes
}

Storage {
  Name = DLT-1
  Address = idefix
  SDPort = 9103
  Password = "some password"
  Device = DLT-1
  Media Type = DLT-8000
}

Storage {
  Name = DLT-2
  Address = idefix
  SDPort = 9103
  Password = "some password"
  Device = DLT-2
  Media Type = DLT-8000
}

Storage {
  Name = DLT-3
  Address = idefix
  SDPort = 9103
  Password = "some password"
  Device = DLT-3
  Media Type = DLT-8000
}

Storage {
  Name = DLT-4
  Address = idefix
  SDPort = 9103
  Password = "some password"
  Device = DLT-4
  Media Type = DLT-8000
}

Storage {
  Name = DLT-5
  Address = idefix
  SDPort = 9103
  Password = "some password"
  Device = DLT-5
  Media Type = DLT-8000
}

# 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 = "/usr/sbin/bsmtp -h obelix -f \"\(Bacula\) bacula@idefix.globul.bg\" -s \"Bacula: %t %e of %c %l\" %r"
  operatorcommand = "/usr/sbin/bsmtp -h obelix -f \"\(Bacula\) bacula@idefix.globul.bg\" -s \"Bacula: Intervention needed for %j\" %r"
  mail = kmedarski@globul.bg = all, !skipped            
  operator = kmedarski@globul.bg = 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/log/bacula.log" = all, !skipped
}


#
# Message delivery for daemon messages (no job).
Messages {
  Name = Daemon
  mailcommand = "/usr/sbin/bsmtp -h obelix -f \"\(Bacula\) bacula@idefix.globul.bg\" -s \"Bacula daemon message\" %r"
  mail = kmedarski@globul.bg = all, !skipped            
  console = all, !skipped, !saved
  append = "/var/lib/bacula/log" = all, !skipped
}


Pool {
  Name = Obelix 
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 12 d 
  Volume Use Duration = 1 d
  MaximumVolumeJobs = 1 
}

Pool {
  Name = Dogmatix
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 12 d
  Volume Use Duration = 1 d
  MaximumVolumeJobs = 1
}

Pool {
  Name = Incremental
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 13 d
  Volume Use Duration = 6 d
  MaximumVolumeJobs = 12 
}


# Restricted console used by tray-monitor to get the status of the director

Console {
  Name = dogmatix-mon
  Password = "some password"
  CommandACL = status, .status
}
Console {
  Name = obelix-mon
  Password = "some password"
  CommandACL = status, .status
}
