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"
12 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 @#setdebug level=100 storage=File
29 label storage=File volume=TestVolume001
30 label storage=File volume=TestVolume002
38 check_for_zombie_jobs storage=File
40 # Now create two new files to be restored later
43 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
44 cp -f ${cwd}/tmp/build/dird.c ${cwd}/tmp/build/ficheriro2.txt
46 cat <<END_OF_DATA >tmp/bconcmds
50 @# Force Incremental on the second Volume
51 update volume=TestVolume001 VolStatus=Used
52 run level=Differential job=$JobName yes
61 touch ${cwd}/tmp/build/ficheriro1.txt
62 touch ${cwd}/tmp/build/ficheriro2.txt
64 cat <<END_OF_DATA >tmp/bconcmds
68 run level=Incremental job=$JobName yes
78 cp -f ficheriro2.txt 1
79 sed "s%a%b%g" 1 >ficheriro2.txt
82 cat <<END_OF_DATA >tmp/bconcmds
86 run level=Differential job=$JobName yes
95 touch ${cwd}/tmp/build/ficheriro1.txt
96 touch ${cwd}/tmp/build/ficheriro2.txt
97 cat <<END_OF_DATA >tmp/bconcmds
101 run level=Incremental job=$JobName yes
110 touch ${cwd}/tmp/build/ficheriro1.txt
111 touch ${cwd}/tmp/build/ficheriro2.txt
112 cat <<END_OF_DATA >tmp/bconcmds
116 run level=Incremental job=$JobName yes
125 touch ${cwd}/tmp/build/ficheriro1.txt
126 touch ${cwd}/tmp/build/ficheriro2.txt
127 cat <<END_OF_DATA >tmp/bconcmds
131 run level=Incremental job=$JobName yes
139 touch ${cwd}/tmp/build/ficheriro1.txt
140 touch ${cwd}/tmp/build/ficheriro2.txt
142 cat <<END_OF_DATA >tmp/bconcmds
146 run level=Incremental job=$JobName yes
153 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
162 check_for_zombie_jobs storage=File
167 # Delete .c files because we will only restored the txt files
170 check_restore_tmp_build_diff