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"
16 ./drop_bacula_tables >/dev/null 2>&1
17 ./make_bacula_tables >/dev/null 2>&1
18 ./grant_bacula_privileges 2>&1 >/dev/null
21 scripts/copy-2disk-confs
22 scripts/prepare-two-disks
24 echo "${cwd}/tmp/build" >/tmp/file-list
25 if test ! -d ${cwd}/tmp/build ; then
26 mkdir ${cwd}/tmp/build
28 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
30 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
31 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
34 change_jobname $JobName
37 # Write out bconsole commands
38 cat <<END_OF_DATA >tmp/bconcmds
42 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
43 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=0
52 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
53 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
56 cat <<END_OF_DATA >tmp/bconcmds
60 @# Force Incremental on the second Volume
61 update volume=TestVolume001 VolStatus=Used
62 run level=Incremental job=$JobName yes
69 restore where=${cwd}/tmp/bacula-restores
71 <${cwd}/tmp/restore-list
82 check_for_zombie_jobs storage=File
85 # Delete .c files because we will only restored the txt files
90 check_restore_tmp_build_diff
93 # This script seems to more or less randomly fail, so we
94 # add extra code here to produce a "dump" in the event of
97 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
102 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build