3 # Run a accurate backup of the Bacula build directory
6 TestName="accurate-test"
12 /bin/cp -f scripts/bacula-dir.conf.accurate bin/bacula-dir.conf
13 sed -i s/all,/all,saved,/ bin/bacula-fd.conf
15 change_jobname Client1 $JobName
18 rm -rf ${cwd}/build/accurate.new
19 rm -rf ${cwd}/build/accurate
23 mkdir ${cwd}/build/accurate
24 echo "test test" > ${cwd}/build/accurate/xxx
25 echo "test test" > ${cwd}/build/accurate/yyy
26 echo "test test" > ${cwd}/build/accurate/zzz
27 echo ${cwd}/build > ${cwd}/tmp/file-list
31 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
34 label volume=TestVolume001 storage=File pool=Default
40 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
41 @$out ${cwd}/tmp/log1.out
48 @$out ${cwd}/tmp/log2.out
49 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
57 ################################################################
58 # First : We just run full and restore to compare if all is ok
59 ################################################################
62 check_for_zombie_jobs storage=File
67 rm -rf ${cwd}/tmp/bacula-restores
69 ################################################################
70 # Now do a second backup after making a few changes
71 ################################################################
72 rm ${cwd}/build/accurate/xxx # delete a file
75 check_for_zombie_jobs storage=File
80 rm -rf ${cwd}/tmp/bacula-restores
82 ################################################################
83 # Now do a third backup after making a few changes
84 ################################################################
86 # some files will have disappear, others have their old mtime/ctime
87 mv ${cwd}/build/accurate ${cwd}/build/accurate.new
90 check_for_zombie_jobs storage=File
95 rm -rf ${cwd}/tmp/bacula-restores
97 ################################################################
98 # Now do an other test in differential mode
99 ################################################################
101 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
102 @$out ${cwd}/tmp/log1.out
103 run job=$JobName level=differential yes
109 @$out ${cwd}/tmp/log2.out
110 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
119 check_for_zombie_jobs storage=File
124 rm -rf ${cwd}/tmp/bacula-restores
126 ################################################################
127 # Now do an other test in differential mode + incremental
128 ################################################################
131 mv ${cwd}/build/accurate.new ${cwd}/build/accurate
133 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
134 @$out ${cwd}/tmp/log1.out
141 @$out ${cwd}/tmp/log2.out
142 restore fileset=FS_TESTJOB where=${cwd}/tmp/bacula-restores select all done
151 check_for_zombie_jobs storage=File
156 rm -rf ${cwd}/tmp/bacula-restores
159 ################################################################
160 # Now do a test with other attributes (owner, gid, rights)
161 ################################################################
163 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
164 @$out ${cwd}/tmp/log1.out
165 run job=backup_advance yes
171 @$out ${cwd}/tmp/log2.out
172 restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done
181 check_for_zombie_jobs storage=File
186 rm -rf ${cwd}/tmp/bacula-restores
189 ################################################################
190 # Use the p option for verify
191 ################################################################
193 chmod 400 ${cwd}/build/accurate/yyy
195 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
196 @$out ${cwd}/tmp/log1.out
197 run job=backup_advance yes
203 @$out ${cwd}/tmp/log2.out
204 restore fileset=FS_TESTJOB_ADVANCE where=${cwd}/tmp/bacula-restores select all done
213 check_for_zombie_jobs storage=File
218 rm -rf ${cwd}/tmp/bacula-restores
220 if ! grep 'st_mode differ' tmp/log1.out > /dev/null