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 echo "${cwd}/build" >/tmp/file-list
16 sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
18 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
19 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
21 change_jobname NightlySave $JobName
24 cat <<END_OF_DATA >tmp/bconcmds
28 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
29 run job=$JobName level=Full yes
36 restore where=${cwd}/tmp/bacula-restores storage=DDS-4 file=<${cwd}/tmp/restore2-list
45 check_for_zombie_jobs storage=DDS-4
50 # We need to stop and start Bacula to
51 # test appending to a previously written tape
53 for i in `cat ${cwd}/tmp/restore2-list`; do
54 diff $i ${cwd}/tmp/bacula-restores$i
60 cat <<END_OF_DATA >tmp/bconcmds
64 run job=$JobName level=Full yes
71 restore where=${cwd}/tmp/bacula-restores
73 <${cwd}/tmp/restore2-list
83 # Bacula was stopped, but we must restart it to
84 # test appending to a previously written tape
87 check_for_zombie_jobs storage=DDS-4
92 scripts/check_for_zombie_jobs storage=DDS-4
93 bin/bacula stop 2>&1 >/dev/null
94 for i in `cat ${cwd}/tmp/restore2-list`; do
95 diff $i ${cwd}/tmp/bacula-restores$i