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
49 # make some files for the incremental to pick up
50 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
51 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
56 cat <<END_OF_DATA >tmp/bconcmds
60 run job=$JobName level=Incremental yes
67 scripts/check_for_zombie_jobs storage=tape
70 touch ${cwd}/build/src/dird/*.c
71 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
77 scripts/check_for_zombie_jobs storage=tape
80 # make some files for the incremental to pick up
81 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
82 #echo "abc" > ${cwd}/build/src/lib/dummy
88 scripts/check_for_zombie_jobs storage=tape
94 # now drop and recreate the database
97 ./drop_bacula_tables >/dev/null 2>&1
98 ./make_bacula_tables >/dev/null 2>&1
99 ./grant_bacula_privileges 2>&1 >/dev/null
102 echo "volume=TestVolume001" >tmp/bscan.bsr
106 # If the database has a password pass it to bscan
107 if test "x${db_password}" = "x"; then
110 PASSWD="-P ${db_password}"
113 if test "$debug" -eq 1 ; then
114 $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
116 $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
121 cat <<END_OF_DATA >tmp/bconcmds
128 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
136 check_for_zombie_jobs storage=tape
138 rm -f ${cwd}/build/src/lib/dummy