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
24 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
25 if test ! -d ${cwd}/tmp/build ; then
26 mkdir -p ${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
36 # Write out bconsole commands
37 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
40 @$out ${cwd}/tmp/log1.out
41 label storage=tape volume=TestVolume001 slot=$SLOT1 Pool=Default drive=$DRIVE1
42 label storage=tape volume=TestVolume002 slot=$SLOT2 Pool=Default drive=$DRIVE1
43 run job=NightlySave yes
51 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
52 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
54 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
57 @$out ${cwd}/tmp/log1.out
58 @# Force Incremental on the second Volume
59 update volume=TestVolume001 VolStatus=Used
60 run level=Incremental job=NightlySave yes
66 @$out ${cwd}/tmp/log2.out
67 restore where=${cwd}/tmp/bacula-restores
69 <${cwd}/tmp/restore-list
79 check_for_zombie_jobs storage=tape
85 # Delete .c files because we will only restored the txt files
87 rm -f ${cwd}/tmp/build/*.c
89 check_restore_tmp_build_diff