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 autochanger and two tapes
8 TestName="incremental-changer"
9 JobName=incrementalchanger
16 scripts/copy-2tape-confs
17 scripts/prepare-two-tapes
19 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
20 if test ! -d ${cwd}/tmp/build ; then
21 mkdir -p ${cwd}/tmp/build
23 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
25 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
26 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
31 # Write out bconsole commands
32 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
35 @$out ${cwd}/tmp/log1.out
36 label storage=tape volume=TestVolume001 slot=$SLOT1 Pool=Default drive=$DRIVE1
37 label storage=tape volume=TestVolume002 slot=$SLOT2 Pool=Default drive=$DRIVE1
38 run job=NightlySave yes
46 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
47 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
49 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
52 @$out ${cwd}/tmp/log1.out
53 @# Force Incremental on the second Volume
54 update volume=TestVolume001 VolStatus=Used
55 run level=Incremental job=NightlySave yes
61 @$out ${cwd}/tmp/log2.out
62 restore where=${cwd}/tmp/bacula-restores
64 <${cwd}/tmp/restore-list
74 check_for_zombie_jobs storage=tape
80 # Delete .c files because we will only restored the txt files
82 rm -f ${cwd}/tmp/build/*.c
84 check_restore_tmp_build_diff