--- /dev/null
+#
+# 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.1.x
+#
+# Special conf for testing two tape drives with two different
+# Media.
+#
+
+Director { # define myself
+ Name = @hostname@-dir
+ DIRport = 8101 # where we listen for UA connections
+ QueryFile = "@scriptdir@/query.sql"
+ WorkingDirectory = "@working_dir@"
+ PidDirectory = "@piddir@"
+ Maximum Concurrent Jobs = 4
+ Password = "dir-pw"
+ Messages = Daemon
+}
+
+#
+# Define the main nightly save backup job
+# By default, this job will back up to disk in /tmp
+Job {
+ Name = "NightlySave"
+ Type = Backup
+ Client=@hostname@-fd
+ FileSet="Full Set"
+ Storage = DDS-4
+ Messages = Standard
+ Pool = Default
+ Write Bootstrap = "@working_dir@/NightlySave.bsr"
+ Maximum Concurrent Jobs = 4
+ SpoolData = yes
+# Prefer Mounted Volumes = no
+}
+
+# Standard Restore template, to be changed by Console program
+Job {
+ Name = "RestoreFiles"
+ Type = Restore
+ Client=@hostname@-fd
+ FileSet="Full Set"
+ Storage = DDS-4
+ Messages = Standard
+ Pool = Default
+ Where = /tmp/bacula-restores
+}
+
+
+# List of files to be backed up
+FileSet {
+ Name = "Full Set"
+ Include { Options { signature=MD5 }
+ File = </tmp/file-list
+ }
+}
+
+
+#
+# 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 1:05
+ Run = Differential 2nd-5th sun at 1:05
+ Run = Incremental mon-sat at 1:05
+}
+
+# Client (File Services) to backup
+Client {
+ Name = @hostname@-fd
+ Address = @hostname@
+ FDPort = 8102
+ Catalog = MyCatalog
+ Password = "client-pw"
+ File Retention = 30d # 30 days
+ Job Retention = 180d # six months
+ AutoPrune = yes # Prune expired Jobs/Files
+ Maximum Concurrent Jobs = 4
+}
+
+# Definition of DDS tape storage device
+Storage {
+ Name = DDS-4
+ Address = @hostname@ # N.B. Use a fully qualified name here
+ SDPort = 8103
+ Password = "storage-pw"
+ Device = DDS-4 # must be same as Device in Storage daemon
+ Media Type = DDS-4 # must be same as MediaType in Storage daemon
+ Maximum Concurrent Jobs = 4
+ Autochanger = yes
+}
+
+
+# Definition of DLT tape storage device
+Storage {
+ Name = DLT80
+ Address = @hostname@ # N.B. Use a fully qualified name here
+ SDPort = 8103
+ Password = "storage-pw"
+ Device = DLT80 # must be same as Device in Storage daemon
+ Media Type = DLT8000 # must be same as MediaType in Storage daemon
+ Maximum Concurrent Jobs = 4
+}
+
+
+# Generic catalog service
+Catalog {
+ Name = MyCatalog
+ dbname = regress; user = regress; password = ""
+}
+
+# Reasonable message delivery -- send most everything to email address
+# and to the console
+Messages {
+ Name = Standard
+ mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression Job %j\) %r\" -s \"Regression: %t %e of %c %l\" %r"
+ operatorcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression Job %j\) %r\" -s \"Regression: Intervention needed for %j\" %r"
+ MailOnError = @job_email@ = all, !terminate
+ operator = @job_email@ = mount
+ console = all, !skipped, !terminate, !restored
+#
+# 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 the scroll off the console.
+#
+ append = "@working_dir@/log" = all, !skipped
+}
+
+#
+# Message delivery for daemon messages (no job).
+Messages {
+ Name = Daemon
+ mailcommand = "@sbindir@/bsmtp -h localhost -f \"\(Bacula regression\) %r\" -s \"Regression daemon message\" %r"
+ mail = @job_email@ = all, !skipped
+ console = all, !skipped, !saved
+ append = "@working_dir@/log" = all, !skipped
+}
+
+
+# Default pool definition
+Pool {
+ Name = Default
+ Pool Type = Backup
+ Recycle = yes # Bacula can automatically recycle Volumes
+ AutoPrune = yes # Prune expired volumes
+ Volume Retention = 365d # one year
+}
+
+Pool {
+ Name = Full
+ Pool Type = Backup
+ Recycle = yes # Bacula can automatically recycle Volumes
+ AutoPrune = yes # Prune expired volumes
+ Volume Retention = 365d # one year
+}
+
+Pool {
+ Name = Inc
+ Pool Type = Backup
+ Recycle = yes # Bacula can automatically recycle Volumes
+ AutoPrune = yes # Prune expired volumes
+ Volume Retention = 365d # one year
+}
+
+Pool {
+ Name = Scratch
+ Pool Type = Backup
+ Recycle = yes # Bacula can automatically recycle Volumes
+ AutoPrune = yes # Prune expired volumes
+ Volume Retention = 365d # one year
+ Recycle Pool = Scratch # recycle back here
+}
--- /dev/null
+#
+# Default Bacula Storage Daemon Configuration file
+#
+# For Bacula release 2.1.x
+#
+# Special configuration for testing two different tape drives
+# with different Media
+#
+
+Storage { # definition of myself
+ Name = @hostname@-sd
+ SDPort = 8103 # Director's port
+ WorkingDirectory = "@working_dir@"
+ Pid Directory = "@piddir@"
+ Subsys Directory = "@subsysdir@"
+}
+
+#
+# List Directors who are permitted to contact Storage daemon
+#
+Director {
+ Name = @hostname@-dir
+ Password = "storage-pw"
+}
+
+#
+# Devices supported by this Storage daemon
+# To connect, the Director's bacula-dir.conf must have the
+# same Name and MediaType.
+#
+Autochanger {
+ Name = DDS-4
+ Changer Device = @autochanger@
+ Changer Command ="@scriptdir@/mtx-changer %c %o %S %a %d"
+ Device = Drive-0
+}
+
+Device {
+ Name = Drive-0
+ Media Type = DDS-4
+ Archive Device = @tape_drive@
+ AutomaticMount = yes; # when device opened, read it
+ Autochanger = yes
+ Drive Index = 0
+ AlwaysOpen = yes;
+ RemovableMedia = yes;
+ @@sbindir@/tape_options
+# Maximum File Size = 1000000
+}
+
+Device {
+ Name = DLT80
+ Media Type = DLT8000
+ Archive Device = @tape_drive1@
+ AutomaticMount = yes; # when device opened, read it
+ AlwaysOpen = yes;
+ RemovableMedia = yes;
+ @@sbindir@/tape_options
+# Maximum File Size = 1000000
+}
+
+
+#
+# Send all messages to the Director,
+# mount messages also are sent to the email address
+#
+Messages {
+ Name = Standard
+ director = @hostname@-dir = all, !terminate
+}
--- /dev/null
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory then create some
+# new files, do an Incremental onto a different medium
+# and then restore everything.
+#
+# This script uses the two different tape drives.
+#
+TestName="incremental-2media-tape"
+JobName=Inc2mediaTape
+. scripts/functions
+
+
+scripts/cleanup
+# Get conf files
+/bin/cp -f scripts/bacula-dir-2d.conf bin/bacula-dir.conf
+/bin/cp -f scripts/bacula-sd-2d.conf bin/bacula-sd.conf
+/bin/cp -f scripts/bacula-fd-2d.conf bin/bacula-fd.conf
+/bin/cp -f scripts/bconsole-2d.conf bin/bconsole.conf
+
+# get proper SD tape definitions
+cp -f scripts/linux_tape_options bin/tape_options
+if test x`uname` = xFreeBSD ; then
+ cp -f scripts/freebsd_tape_options bin/tape_options
+fi
+
+mt -f /dev/nst0 rewind
+mt -f /dev/nst0 weof
+mt -f /dev/nst1 rewind
+mt -f /dev/nst1 weof
+
+echo "${cwd}/build" >/tmp/file-list
+
+change_jobname $JobName
+start_test
+
+# Write out bconsole commands
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+@$out tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
+label storage=DLT80 volume=TestVolume002 Pool=Default
+run job=$JobName yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bacula
+
+echo "Backup 1 done"
+# make some files for the incremental to pick up
+touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
+touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
+
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
+messages
+@$out tmp/log1.out
+@# Force Incremental on the second Volume
+update volume=TestVolume001 VolStatus=Used
+setdebug level=51 storage=DLT80
+run level=Incremental job=$JobName storage=DLT80 yes
+wait
+list volumes
+messages
+@#
+@# now do a restore
+@#
+@$out tmp/log2.out
+setdebug level=51 storage=DDS-4
+restore where=${cwd}/tmp/bacula-restores select all done
+yes
+wait
+messages
+@$out
+quit
+END_OF_DATA
+
+run_bconsole
+
+check_for_zombie_jobs storage=DLT80
+stop_bacula
+
+check_two_logs
+check_restore_diff
+
+end_test