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"
15 scripts/copy-tape-confs
18 echo "${cwd}/build" >${cwd}/tmp/file-list
19 sed s%\^%${cwd}% ${cwd}/scripts/flist | sort | uniq >${cwd}/tmp/restore2-list
21 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
22 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
24 change_jobname NightlySave $JobName
27 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
30 @$out ${cwd}/tmp/log1.out
31 label storage=tape volume=TestVolume001 slot=0 pool=Default
32 run job=$JobName level=Full yes
38 @$out ${cwd}/tmp/log2.out
39 restore where=${cwd}/tmp/bacula-restores storage=tape file=<${cwd}/tmp/restore2-list
47 check_for_zombie_jobs storage=tape
52 # We need to stop and start Bacula to
53 # test appending to a previously written tape
55 for i in `cat ${cwd}/tmp/restore2-list`; do
56 diff $i ${cwd}/tmp/bacula-restores$i
62 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
65 @$out ${cwd}/tmp/log1.out
66 run job=$JobName level=Full yes
72 @$out ${cwd}/tmp/log2.out
73 restore where=${cwd}/tmp/bacula-restores
75 <${cwd}/tmp/restore2-list
84 # Bacula was stopped, but we must restart it to
85 # test appending to a previously written tape
88 check_for_zombie_jobs storage=tape
93 scripts/check_for_zombie_jobs storage=tape
95 for i in `cat ${cwd}/tmp/restore2-list`; do
96 diff $i ${cwd}/tmp/bacula-restores$i