3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
7 # Run a simple backup of the Bacula build directory
8 # then restore it. Used to generate BSR files.
18 # Zap out any schedule in default conf file so that
19 # it doesn't start during our test
22 echo "s% Schedule =%# Schedule =%g" >${outf}
23 echo "s% Write Bootstrap%# Write Bootstrap%g" >> ${outf}
24 cp $scripts/bacula-dir.conf $tmp/1
25 sed -f ${outf} $tmp/1 >$scripts/bacula-dir.conf
27 $bperl -e "add_attribute('$conf/bacula-sd.conf', 'MaximumFileSize', '1MB', 'Device')"
29 change_jobname BackupClient1 $JobName
32 cat <<END_OF_DATA >$tmp/bconcmds
36 label volume=TestVolume001 storage=File1 pool=File slot=1 drive=0
44 restore where=$tmp/bacula-restores select all done
45 @exec "sh -c 'cp $working/*.bsr $tmp/1.bsr'"
53 check_for_zombie_jobs storage=File1
59 # here we can add checks on the BSR file
60 awk '/Volume=/ { nbvol++ } /FileIndex=/ { nbfdx++ } END { print "Found Volumes=" nbvol " FileIndexes=" nbfdx }' $tmp/1.bsr