3 # Run a simple backup of the Bacula build directory using the compressed option
4 # then backup four times, each with incremental then finally restore.
5 # It should require at least 4 different bsrs.
9 scripts/copy-tape-confs
11 echo "${cwd}/build" >/tmp/file-list
15 echo " === Starting relabel-tape at `date +%R:%S` ==="
16 echo " === Starting relabel-tape at `date +%R:%S` ===" >>working/log
19 bin/bacula start 2>&1 >/dev/null
21 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
22 #bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
26 label storage=DDS-4 volume=TestVolume001 slot=0
27 run job=NightlySave level=Full yes
35 update volume=TestVolume001
39 run job=NightlySave level=Full yes
43 purge volume=TestVolume001
44 relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0
54 # now do several restores to ensure we cleanup between jobs
56 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
58 restore where=${cwd}/tmp/bacula-restores select all done
61 restore where=${cwd}/tmp/bacula-restores select all done
66 @# now unmount the tape and start two restores
70 restore where=${cwd}/tmp/bacula-restores select all done
72 restore where=${cwd}/tmp/bacula-restores select
83 scripts/check_for_zombie_jobs storage=DDS-4
84 bin/bacula stop 2>&1 >/dev/null
85 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
87 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
89 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
91 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
94 echo " !!!!! relabel-tape Bacula source failed!!! !!!!! "
95 echo " !!!!! relabel-tape failed!!! !!!!! " >>test.out
96 echo "diff=$dstat backup=$bstat restore=$rstat"
99 echo " ===== relabel-tape Bacula source OK ===== "
100 echo " ===== relabel-tape OK ===== " >>test.out