9 # Run a accurate backup of the Bacula build directory
12 TestName="accurate-test"
18 /bin/cp -f scripts/bacula-dir.conf.accurate bin/bacula-dir.conf
19 sed -i s/all,/all,saved,/ bin/bacula-fd.conf
21 change_jobname Client1 $JobName
24 rm -rf ${cwd}/build/accurate.new
25 rm -rf ${cwd}/build/accurate
29 mkdir ${cwd}/build/accurate
30 echo "test test" > ${cwd}/build/accurate/xxx
31 echo "test test" > ${cwd}/build/accurate/yyy
32 echo "test test" > ${cwd}/build/accurate/zzz
33 echo ${cwd}/build > ${cwd}/tmp/file-list
37 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
40 label volume=TestVolume001 storage=File pool=Default
41 label volume=TestVolume002 storage=File pool=Default
47 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
48 @$out ${cwd}/tmp/log1.out
55 @$out ${cwd}/tmp/log2.out
56 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
64 ################################################################
65 # First : We just run full and restore to compare if all is ok
66 ################################################################
69 check_for_zombie_jobs storage=File
74 rm -rf ${cwd}/tmp/bacula-restores
76 ################################################################
77 # Now do a second backup after making few changes
78 ################################################################
79 rm ${cwd}/build/accurate/xxx # delete a file
82 check_for_zombie_jobs storage=File
87 rm -rf ${cwd}/tmp/bacula-restores
89 ################################################################
91 ################################################################
93 ${cwd}/bin/bls -c ${cwd}/bin/bacula-sd.conf -V 'TestVolume001|TestVolume002' FileStorage > tmp/bls.out
94 if ! grep -- '----' tmp/bls.out | grep xxx > /dev/null
99 ################################################################
100 # Now do a third backup after making few changes
101 ################################################################
103 # some files will have disappear, others have their old mtime/ctime
104 mv ${cwd}/build/accurate ${cwd}/build/accurate.new
107 check_for_zombie_jobs storage=File
112 rm -rf ${cwd}/tmp/bacula-restores
114 ################################################################
115 # Now do an other test in differential mode
116 ################################################################
118 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
119 @$out ${cwd}/tmp/log1.out
120 run job=$JobName level=differential yes
126 @$out ${cwd}/tmp/log2.out
127 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
136 check_for_zombie_jobs storage=File
141 rm -rf ${cwd}/tmp/bacula-restores
143 ################################################################
144 # Now do an other test in differential mode + incremental
145 ################################################################
148 mv ${cwd}/build/accurate.new ${cwd}/build/accurate
150 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
151 @$out ${cwd}/tmp/log1.out
158 @$out ${cwd}/tmp/log2.out
159 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
168 check_for_zombie_jobs storage=File
173 rm -rf ${cwd}/tmp/bacula-restores
175 ################################################################
177 ################################################################
182 ./drop_bacula_tables >/dev/null 2>&1
183 ./make_bacula_tables >/dev/null 2>&1
184 ./grant_bacula_privileges >/dev/null 2>&1
187 echo "volume=TestVolume001" >tmp/bscan.bsr
188 echo "volume=TestVolume002" >>tmp/bscan.bsr
190 ${cwd}/bin/bscan -c ${cwd}/bin/bacula-sd.conf -n regress -u regress -m -s -b tmp/bscan.bsr FileStorage 2>&1 > /dev/null
192 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
193 @$out ${cwd}/tmp/log1.out
198 @$out ${cwd}/tmp/log2.out
199 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
207 # run bacula with just the restore job
210 check_for_zombie_jobs storage=File
215 rm -rf ${cwd}/tmp/bacula-restores
217 ################################################################
218 # Now do a test with other attributes (owner, gid, rights)
219 ################################################################
221 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
222 @$out ${cwd}/tmp/log1.out
223 run job=backup_advance yes
229 @$out ${cwd}/tmp/log2.out
230 restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done
239 check_for_zombie_jobs storage=File
244 rm -rf ${cwd}/tmp/bacula-restores
247 ################################################################
248 # Use the p option for verify
249 ################################################################
251 chmod 400 ${cwd}/build/accurate/yyy
253 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
254 @$out ${cwd}/tmp/log1.out
255 run job=backup_advance yes
261 @$out ${cwd}/tmp/log2.out
262 restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done
271 check_for_zombie_jobs storage=File
276 rm -rf ${cwd}/tmp/bacula-restores
278 if ! grep 'st_mode differ' tmp/log1.out > /dev/null