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 TestName="incremental-test"
16 ${rscripts}/copy-test-confs
17 echo "${tmpsrc}" >${tmp}/file-list
19 cp -p ${src}/src/dird/*.c ${tmpsrc}
21 echo "${tmpsrc}/ficheriro1.txt" >restore-list
22 echo "${tmpsrc}/ficheriro2.txt" >>restore-list
25 change_jobname CompressedTest $JobName
28 cat <<END_OF_DATA >${tmp}/bconcmds
32 setdebug level=4 storage=File
33 @#setdebug level=200 client
34 @#setdebug level=100 director
35 label storage=File volume=TestVolume001
36 label storage=File volume=TestVolume002
45 check_for_zombie_jobs storage=File
47 # Now create two new files to be restored later
50 echo "ficheriro1.txt" >${tmpsrc}/ficheriro1.txt
51 cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt
53 cat <<END_OF_DATA >${tmp}/bconcmds
57 @# Force Incremental on the second Volume
58 setdebug level=4 storage=File
59 update volume=TestVolume001 VolStatus=Used
60 run level=Differential job=$JobName yes
69 touch ${tmpsrc}/ficheriro1.txt
70 touch ${tmpsrc}/ficheriro2.txt
72 cat <<END_OF_DATA >${tmp}/bconcmds
76 setdebug level=4 storage=File
77 run level=Incremental job=$JobName yes
87 cp -f ficheriro2.txt 1
88 sed "s%a%b%g" 1 >ficheriro2.txt
91 cat <<END_OF_DATA >${tmp}/bconcmds
95 setdebug level=4 storage=File
96 run level=Differential job=$JobName yes
105 touch ${tmpsrc}/ficheriro1.txt
106 touch ${tmpsrc}/ficheriro2.txt
107 cat <<END_OF_DATA >${tmp}/bconcmds
110 @$out ${tmp}/log1.out
111 setdebug level=4 storage=File
112 run level=Incremental job=$JobName yes
121 touch ${tmpsrc}/ficheriro1.txt
122 touch ${tmpsrc}/ficheriro2.txt
123 cat <<END_OF_DATA >${tmp}/bconcmds
126 @$out ${tmp}/log1.out
127 setdebug level=4 storage=File
128 run level=Incremental job=$JobName yes
137 touch ${tmpsrc}/ficheriro1.txt
138 touch ${tmpsrc}/ficheriro2.txt
139 cat <<END_OF_DATA >${tmp}/bconcmds
142 @$out ${tmp}/log1.out
143 setdebug level=4 storage=File
144 run level=Incremental job=$JobName yes
152 touch ${tmpsrc}/ficheriro1.txt
153 touch ${tmpsrc}/ficheriro2.txt
155 cat <<END_OF_DATA >${tmp}/bconcmds
158 @$out ${tmp}/log1.out
159 setdebug level=4 storage=File
160 run level=Incremental job=$JobName yes
166 @$out ${tmp}/log2.out
167 setdebug level=10 storage=File
168 restore where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list
178 check_for_zombie_jobs storage=File
183 # Delete .c files because we will only restored the txt files
186 check_restore_tmp_build_diff