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 TestName="incremental-test"
11 scripts/copy-test-confs
13 echo "${cwd}/tmp/build" >/tmp/file-list
14 mkdir ${cwd}/tmp/build
15 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
17 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
18 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
21 change_jobname CompressedTest $JobName
24 cat <<END_OF_DATA >tmp/bconcmds
28 label storage=File volume=TestVolume001
29 label storage=File volume=TestVolume002
37 check_for_zombie_jobs storage=File
39 # Now create two new files to be restored later
42 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
43 cp -f ${cwd}/tmp/build/dird.c ${cwd}/tmp/build/ficheriro2.txt
45 cat <<END_OF_DATA >tmp/bconcmds
49 @# Force Incremental on the second Volume
50 update volume=TestVolume001 VolStatus=Used
51 run level=Differential job=$JobName yes
60 touch ${cwd}/tmp/build/ficheriro1.txt
61 touch ${cwd}/tmp/build/ficheriro2.txt
63 cat <<END_OF_DATA >tmp/bconcmds
67 run level=Incremental job=$JobName yes
77 cp -f ficheriro2.txt 1
78 sed "s%a%b%g" 1 >ficheriro2.txt
81 cat <<END_OF_DATA >tmp/bconcmds
85 run level=Differential job=$JobName yes
94 touch ${cwd}/tmp/build/ficheriro1.txt
95 touch ${cwd}/tmp/build/ficheriro2.txt
96 cat <<END_OF_DATA >tmp/bconcmds
100 run level=Incremental job=$JobName yes
109 touch ${cwd}/tmp/build/ficheriro1.txt
110 touch ${cwd}/tmp/build/ficheriro2.txt
111 cat <<END_OF_DATA >tmp/bconcmds
115 run level=Incremental job=$JobName yes
124 touch ${cwd}/tmp/build/ficheriro1.txt
125 touch ${cwd}/tmp/build/ficheriro2.txt
126 cat <<END_OF_DATA >tmp/bconcmds
130 run level=Incremental job=$JobName yes
138 touch ${cwd}/tmp/build/ficheriro1.txt
139 touch ${cwd}/tmp/build/ficheriro2.txt
141 cat <<END_OF_DATA >tmp/bconcmds
145 run level=Incremental job=$JobName yes
152 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
161 check_for_zombie_jobs storage=File
166 # Delete .c files because we will only restored the txt files
169 check_restore_tmp_build_diff