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
36 @# set status to append
37 update volume=TestVolume001
40 run job=NightlySave level=Full yes
44 purge volume=TestVolume001
45 relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0 pool=Default
50 run job=NightlySave level=Full yes
57 if test "$debug" -eq 1 ; then
59 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
61 bin/bacula start 2>&1 >/dev/null
62 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
67 # now do several restores to ensure we cleanup between jobs
69 cat <<END_OF_DATA >tmp/bconcmds
71 restore where=${cwd}/tmp/bacula-restores select all done
74 restore where=${cwd}/tmp/bacula-restores select all done
79 @# now unmount the tape and start two restores
83 restore where=${cwd}/tmp/bacula-restores select all done
85 restore where=${cwd}/tmp/bacula-restores select
97 if test "$debug" -eq 1 ; then
98 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
100 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
103 scripts/check_for_zombie_jobs storage=DDS-4
104 bin/bacula stop 2>&1 >/dev/null
105 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
107 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
109 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
111 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
114 echo " !!!!! relabel-tape Bacula source failed!!! !!!!! "
115 echo " !!!!! relabel-tape failed!!! !!!!! " >>test.out
116 echo "diff=$dstat backup=$bstat restore=$rstat"
119 echo " ===== relabel-tape Bacula source OK ===== "
120 echo " ===== relabel-tape OK ===== " >>test.out