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-test"
14 if test x${AUTOCHANGER} = x/dev/null ; then
15 echo "incremental-2disk test skipped. No autochanger."
21 ./drop_bacula_tables >/dev/null 2>&1
22 ./make_bacula_tables >/dev/null 2>&1
23 ./grant_bacula_privileges 2>&1 >/dev/null
26 scripts/copy-2disk-confs
27 scripts/prepare-two-disks
29 echo "${cwd}/tmp/build" >/tmp/file-list
30 if test ! -d ${cwd}/tmp/build ; then
31 mkdir ${cwd}/tmp/build
33 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
35 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
36 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
39 change_jobname $JobName
42 # Write out bconsole commands
43 cat <<END_OF_DATA >tmp/bconcmds
47 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
48 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=0
57 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
58 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
61 cat <<END_OF_DATA >tmp/bconcmds
65 @# Force Incremental on the second Volume
66 update volume=TestVolume001 VolStatus=Used
67 run level=Incremental job=$JobName yes
74 restore where=${cwd}/tmp/bacula-restores
76 <${cwd}/tmp/restore-list
87 check_for_zombie_jobs storage=File
90 # Delete .c files because we will only restored the txt files
95 check_restore_tmp_build_diff