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.
8 if test "$debug" -eq 1 ; then
15 scripts/copy-tape-confs
17 echo "${cwd}/build" >/tmp/file-list
21 echo " === Starting relabel-tape at `date +%R:%S` ==="
22 echo " === Starting relabel-tape at `date +%R:%S` ===" >>working/log
25 cat <<END_OF_DATA >tmp/bconcmds
29 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
30 run job=NightlySave level=Full yes
38 update volume=TestVolume001
42 run job=NightlySave level=Full yes
46 purge volume=TestVolume001
47 relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0 pool=Default
56 if test "$debug" -eq 1 ; then
58 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
60 bin/bacula start 2>&1 >/dev/null
61 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
66 # now do several restores to ensure we cleanup between jobs
68 cat <<END_OF_DATA >tmp/bconcmds
70 restore where=${cwd}/tmp/bacula-restores select all done
73 restore where=${cwd}/tmp/bacula-restores select all done
78 @# now unmount the tape and start two restores
82 restore where=${cwd}/tmp/bacula-restores select all done
84 restore where=${cwd}/tmp/bacula-restores select
96 if test "$debug" -eq 1 ; then
97 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
99 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
102 scripts/check_for_zombie_jobs storage=DDS-4
103 bin/bacula stop 2>&1 >/dev/null
104 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
106 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
108 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
110 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
113 echo " !!!!! relabel-tape Bacula source failed!!! !!!!! "
114 echo " !!!!! relabel-tape failed!!! !!!!! " >>test.out
115 echo "diff=$dstat backup=$bstat restore=$rstat"
118 echo " ===== relabel-tape Bacula source OK ===== "
119 echo " ===== relabel-tape OK ===== " >>test.out