3 # Run a simple backup of the Bacula build directory
4 # to two tapes where the maximum tape file size is set to 1M
7 bin/bacula stop 2>&1 >/dev/null
8 scripts/copy-tape-confs
10 mtx -f /dev/sg0 load 1
11 mt -f /dev/nst0 rewind
13 mtx -f /dev/sg0 unload
14 mtx -f /dev/sg0 load 2
15 mt -f /dev/nst0 rewind
17 mtx -f /dev/sg0 unload
18 echo "${cwd}/build" >/tmp/file-list
19 bin/drop_sqlite_tables
20 bin/make_sqlite_tables
22 echo "s%# Maximum File Size% Maximum File Size%g" >${out}
23 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
24 sed -f ${out} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
28 echo " === Starting Two Volume Tape test ==="
29 echo " === Starting Two Volume Tape test ===" >>working/log
32 bin/bacula start 2>&1 >/dev/null
33 bin/console -c bin/console.conf <<END_OF_DATA
37 label storage=DDS-4 volume=TestVolume001 slot=1
38 label storage=DDS-4 volume=TestVolume002 slot=2
39 update Volume=TestVolume001 MaxVolBytes=3000000
40 run job=NightlySave yes
47 restore where=${cwd}/tmp/bacula-restores current all
54 bin/bacula stop 2>&1 >/dev/null
55 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
57 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
59 diff -r build tmp/bacula-restores${cwd}/build
60 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
63 echo " !!!!! Two Volume Tape test Bacula source failed!!! !!!!! "
64 echo " !!!!! Two Volume Tape test failed!!! !!!!! " >>test.out
67 echo " ===== Two Volume Tape test Bacula source OK ===== "
68 echo " ===== Two Volume Tape test OK ===== " >>test.out