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
12 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
13 mkdir ${cwd}/tmp/build
14 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
16 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
17 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
20 change_jobname CompressedTest $JobName
23 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
26 @$out ${cwd}/tmp/log1.out
27 @#setdebug level=100 storage=File
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 >${cwd}/tmp/bconcmds
48 @$out ${cwd}/tmp/log1.out
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 >${cwd}/tmp/bconcmds
66 @$out ${cwd}/tmp/log1.out
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 >${cwd}/tmp/bconcmds
84 @$out ${cwd}/tmp/log1.out
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 >${cwd}/tmp/bconcmds
99 @$out ${cwd}/tmp/log1.out
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 >${cwd}/tmp/bconcmds
114 @$out ${cwd}/tmp/log1.out
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 >${cwd}/tmp/bconcmds
129 @$out ${cwd}/tmp/log1.out
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 >${cwd}/tmp/bconcmds
144 @$out ${cwd}/tmp/log1.out
145 setdebug level=200 storage=File
146 run level=Incremental job=$JobName yes
152 @$out ${cwd}/tmp/log2.out
153 setdebug level=10 storage=File
154 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
164 check_for_zombie_jobs storage=File
169 # Delete .c files because we will only restored the txt files
171 rm -f ${cwd}/tmp/build/*.c
172 check_restore_tmp_build_diff