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 echo "${cwd}/build" >${cwd}/tmp/file-list
15 sed s%\^%${cwd}% ${cwd}/scripts/flist | sort | uniq >${cwd}/tmp/restore2-list
17 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
18 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
20 change_jobname NightlySave $JobName
23 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
26 @$out ${cwd}/tmp/log1.out
27 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
28 run job=$JobName level=Full yes
34 @$out ${cwd}/tmp/log2.out
35 restore where=${cwd}/tmp/bacula-restores storage=DDS-4 file=<${cwd}/tmp/restore2-list
44 check_for_zombie_jobs storage=DDS-4
49 # We need to stop and start Bacula to
50 # test appending to a previously written tape
52 for i in `cat ${cwd}/tmp/restore2-list`; do
53 diff $i ${cwd}/tmp/bacula-restores$i
59 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
62 @$out ${cwd}/tmp/log1.out
63 run job=$JobName level=Full yes
69 @$out ${cwd}/tmp/log2.out
70 restore where=${cwd}/tmp/bacula-restores
72 <${cwd}/tmp/restore2-list
82 # Bacula was stopped, but we must restart it to
83 # test appending to a previously written tape
86 check_for_zombie_jobs storage=DDS-4
91 scripts/check_for_zombie_jobs storage=DDS-4
92 bin/bacula stop 2>&1 >/dev/null
93 for i in `cat ${cwd}/tmp/restore2-list`; do
94 diff $i ${cwd}/tmp/bacula-restores$i