3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory but
9 # split the archive into two volumes then bscan it
10 # into the catalog after the backup. It also to a limited
11 # extent tests the purge volume and delete volume commands.
19 scripts/copy-test-confs
20 echo "${cwd}/build" >tmp/file-list
22 change_jobname NightlySave $JobName
25 cat <<END_OF_DATA >tmp/bconcmds
33 update Volume=TestVolume001 MaxVolBytes=3000000
34 run job=$JobName storage=File1
40 select * from JobMedia;
46 @# now purge the Volume
48 purge volume=TestVolume001
49 purge volume=TestVolume002
50 delete volume=TestVolume001
52 delete volume=TestVolume002
59 check_for_zombie_jobs storage=File1
62 echo "volume=TestVolume001" >tmp/bscan.bsr
63 echo "volume=TestVolume002" >>tmp/bscan.bsr
67 # If the database has a password pass it to bscan
68 if test "x${db_password}" = "x"; then
71 PASSWD="-P ${db_password}"
74 if test "$debug" -eq 1 ; then
75 $bin/bscan -w working $BSCANLIBDBI -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp
77 $bin/bscan -w working $BSCANLIBDBI -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp >tmp/log3.out 2>&1
80 cat <<END_OF_DATA >tmp/bconcmds
87 @#setdebug level=400 storage=File1
88 restore bootstrap=${cwd}/tmp/kern.bsr where=${cwd}/tmp/bacula-restores select all storage=File1 done
97 check_for_zombie_jobs storage=File1