3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do an Incremental and restore those two files.
6 # This script uses the virtual disk autochanger
8 TestName="incremental-2disk"
13 scripts/copy-2disk-confs
14 scripts/prepare-disk-changer
16 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
17 if test ! -d ${cwd}/tmp/build ; then
18 mkdir ${cwd}/tmp/build
20 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
22 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
23 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
26 change_jobname $JobName
29 # Write out bconsole commands
30 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @$out ${cwd}/tmp/log1.out
34 label storage=tape volume=TestVolume001 slot=1 Pool=Default drive=0
35 label storage=tape volume=TestVolume002 slot=2 Pool=Default drive=0
44 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
45 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
48 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
51 @$out ${cwd}/tmp/log1.out
52 @# Force Incremental on the second Volume
53 update volume=TestVolume001 VolStatus=Used
54 run level=Incremental job=$JobName yes
60 @$out ${cwd}/tmp/log2.out
61 restore where=${cwd}/tmp/bacula-restores
63 <${cwd}/tmp/restore-list
73 check_for_zombie_jobs storage=File
76 # Delete .c files because we will only restored the txt files
78 rm -f ${cwd}/tmp/build/*.c
81 check_restore_tmp_build_diff
84 # This script seems to more or less randomly fail, so we
85 # add extra code here to produce a "dump" in the event of
88 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
89 cat ${cwd}/tmp/log1.out
91 cat ${cwd}/tmp/log2.out
93 diff -r ${cwd}/tmp/build ${cwd}/tmp/bacula-restores${cwd}/tmp/build