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.
9 TestName="backup-bacula-tape"
15 scripts/copy-tape-confs
18 echo "${cwd}/build" >${cwd}/tmp/file-list
20 change_jobname NightlySave $JobName
24 # Write out bconsole commands
25 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
28 @$out ${cwd}/tmp/log1.out
29 @#setdebug level=200 storage=DDS-4
30 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
31 purge volume=TestVolume001
32 relabel pool=Default storage=DDS-4 oldVolume=TestVolume001 volume=TestVolume002 slot=0
33 purge volume=TestVolume002
34 relabel pool=Default storage=DDS-4 oldVolume=TestVolume002 volume=TestVolume001 slot=0
71 @$out ${cwd}/tmp/log2.out
72 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
80 check_for_zombie_jobs storage=DDS-4
84 # Now do a second backup after making a few changes
86 touch ${cwd}/build/src/dird/*.c
87 echo "test test" > ${cwd}/build/src/dird/xxx
89 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
92 @$out ${cwd}/tmp/log1.out
99 @# now do a second restore
101 @$out ${cwd}/tmp/log2.out
103 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
113 check_for_zombie_jobs storage=DDS-4