3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory then create some
9 # new files, do an Incremental and restore those two files.
11 # This script uses the autochanger and two tapes
13 TestName="incremental-changer"
14 JobName=incrementalchanger
21 scripts/copy-2tape-confs
22 scripts/prepare-two-tapes
26 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
27 if test ! -d ${cwd}/tmp/build ; then
28 mkdir -p ${cwd}/tmp/build
30 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
32 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
33 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
38 # Write out bconsole commands
39 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
42 @$out ${cwd}/tmp/log1.out
43 label storage=tape volume=TestVolume001 slot=$SLOT1 Pool=Default drive=$DRIVE1
44 label storage=tape volume=TestVolume002 slot=$SLOT2 Pool=Default drive=$DRIVE1
45 run job=NightlySave yes
53 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
54 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
56 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
59 @$out ${cwd}/tmp/log1.out
60 @# Force Incremental on the second Volume
61 update volume=TestVolume001 VolStatus=Used
62 run level=Incremental job=NightlySave yes
68 @$out ${cwd}/tmp/log2.out
69 restore where=${cwd}/tmp/bacula-restores
71 <${cwd}/tmp/restore-list
81 check_for_zombie_jobs storage=tape
87 # Delete .c files because we will only restored the txt files
89 rm -f ${cwd}/tmp/build/*.c
91 check_restore_tmp_build_diff