3 # Run a simple backup of the Bacula build directory
4 # to a tape where the maximum tape file size is set to 1M
5 # then restore a few files from it. Note, by setting the maximum
6 # file size to 1M, it runs very slow. There are about 64 files that
7 # are created during each of the two backups.
9 TestName="restore-by-file-tape"
14 scripts/copy-tape-confs
16 echo "${cwd}/build" >/tmp/file-list
17 sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
19 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
20 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
22 change_jobname $JobName
25 cat <<END_OF_DATA >tmp/bconcmds
29 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
30 run job=$JobName level=Full yes
37 restore where=${cwd}/tmp/bacula-restores storage=DDS-4 file=<${cwd}/tmp/restore2-list
46 check_for_zombie_jobs storage=DDS-4
53 # We need to stop and start Bacula to
54 # test appending to a previously written tape
56 for i in `cat ${cwd}/tmp/restore2-list`; do
57 diff $i ${cwd}/tmp/bacula-restores$i
65 cat <<END_OF_DATA >tmp/bconcmds
69 run job=$JobName level=Full yes
76 restore where=${cwd}/tmp/bacula-restores
78 <${cwd}/tmp/restore2-list
88 # Bacula was stopped, but we must restart it to
89 # test appending to a previously written tape
92 check_for_zombie_jobs storage=DDS-4
97 scripts/check_for_zombie_jobs storage=DDS-4
98 bin/bacula stop 2>&1 >/dev/null
99 for i in `cat ${cwd}/tmp/restore2-list`; do
100 diff $i ${cwd}/tmp/bacula-restores$i
101 if [ $? != 0 ] ; then