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"
15 ./drop_bacula_tables >/dev/null 2>&1
16 ./make_bacula_tables >/dev/null 2>&1
17 ./grant_bacula_privileges 2>&1 >/dev/null
20 scripts/copy-2disk-confs
21 scripts/prepare-two-disks
23 echo "${cwd}/tmp/build" >/tmp/file-list
24 if test ! -d ${cwd}/tmp/build ; then
25 mkdir ${cwd}/tmp/build
27 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
29 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
30 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
33 change_jobname $JobName
36 # Write out bconsole commands
37 cat <<END_OF_DATA >tmp/bconcmds
41 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
42 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=0
51 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
52 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
55 cat <<END_OF_DATA >tmp/bconcmds
59 @# Force Incremental on the second Volume
60 update volume=TestVolume001 VolStatus=Used
61 run level=Incremental job=$JobName yes
68 restore where=${cwd}/tmp/bacula-restores
70 <${cwd}/tmp/restore-list
81 check_for_zombie_jobs storage=File
84 # Delete .c files because we will only restored the txt files
89 check_restore_tmp_build_diff
92 # This script seems to more or less randomly fail, so we
93 # add extra code here to produce a "dump" in the event of
96 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
101 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build