3 # Run a simple backup of the Bacula build directory
4 # to a tape then restore it, we do that twice to ensure that
5 # we can correctly append to a tape.
6 # We also use the purge and the relabel commands as
7 # well as a pile of status storage commands.
10 if test "$debug" -eq 1 ; then
17 scripts/copy-tape-confs
20 echo "${cwd}/build" >/tmp/file-list
24 echo " === Starting Backup Bacula tape test at `date +%R:%S` ==="
25 echo " === Starting Backup Bacula tape test at `date +%R:%S` ===" >>working/log
28 # Write out bconsole commands
29 cat <<END_OF_DATA >tmp/bconcmds
33 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
34 purge volume=TestVolume001
35 relabel pool=Default storage=DDS-4 oldVolume=TestVolume001 volume=TestVolume002 slot=0
36 purge volume=TestVolume002
37 relabel pool=Default storage=DDS-4 oldVolume=TestVolume002 volume=TestVolume001 slot=0
38 run job=NightlySave yes
75 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
82 if test "$debug" -eq 1 ; then
84 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
86 bin/bacula start 2>&1 >/dev/null
87 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
90 bin/bacula stop 2>&1 >/dev/null
92 # Now do a second backup after making a few changes
94 touch ${cwd}/build/src/dird/*.c
95 echo "test test" > ${cwd}/build/src/dird/xxx
97 cat <<END_OF_DATA >tmp/bconcmds
102 run job=NightlySave yes
107 @# now do a second restore
111 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
120 if test "$debug" -eq 1 ; then
122 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
124 bin/bacula start 2>&1 >/dev/null
125 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
127 scripts/check_for_zombie_jobs storage=DDS-4
129 bin/bacula stop 2>&1 >/dev/null
130 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
132 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
134 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
135 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
138 echo " !!!!! Backup Bacula tape test failed!!! !!!!! "
139 echo " !!!!! Backup Bacula tape test failed!!! !!!!! " >>test.out
142 echo " ===== Backup Bacula tape test OK ===== "
143 echo " ===== Backup Bacula tape test OK ===== " >>test.out