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 using the compressed option
9 # then backup four times, each with incremental then
10 # do a bscan and restore.
11 # It should require at least 4 different bsrs.
21 echo "${cwd}/build" >tmp/file-list
23 cp ${cwd}/bin/bacula-sd.conf tmp/1
24 sed "s%# Maximum File Size% Maximum File Size%" tmp/1 >${cwd}/bin/bacula-sd.conf
26 change_jobname NightlySave $JobName
29 cat <<END_OF_DATA >tmp/bconcmds
31 estimate job=$JobName listing
32 estimate job=$JobName listing
35 setdebug level=2 storage=tape
36 label storage=tape volume=TestVolume001 slot=0 pool=Default
37 run job=$JobName level=Full yes
39 run job=$JobName level=Full yes
46 check_for_zombie_jobs storage=tape
48 # make some files for the incremental to pick up
49 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
50 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
55 cat <<END_OF_DATA >tmp/bconcmds
59 run job=$JobName level=Incremental yes
66 scripts/check_for_zombie_jobs storage=tape
68 touch ${cwd}/build/src/dird/*.c
69 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
75 scripts/check_for_zombie_jobs storage=tape
77 # make some files for the incremental to pick up
78 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
79 #echo "abc" > ${cwd}/build/src/lib/dummy
85 scripts/check_for_zombie_jobs storage=tape
90 # now drop and recreate the database
93 ./drop_bacula_tables >/dev/null 2>&1
94 ./make_bacula_tables >/dev/null 2>&1
95 ./grant_bacula_privileges 2>&1 >/dev/null
98 echo "volume=TestVolume001" >tmp/bscan.bsr
102 # If the database has a password pass it to bscan
103 if test "x${db_password}" = "x"; then
106 PASSWD="-P ${db_password}"
109 if test "$debug" -eq 1 ; then
110 $bin/bscan -w working $BSCANLIBDBI -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf tape
112 $bin/bscan -w working $BSCANLIBDBI -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf tape >/dev/null 2>&1
117 cat <<END_OF_DATA >tmp/bconcmds
124 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
132 check_for_zombie_jobs storage=tape
134 rm -f ${cwd}/build/src/lib/dummy