3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do an Incremental and restore those two files.
7 bin/bacula stop 2>&1 >/dev/null
9 ./drop_bacula_tables >/dev/null 2>&1
10 ./make_bacula_tables >/dev/null 2>&1
11 ./grant_bacula_privileges 2>&1 >/dev/null
14 scripts/copy-tape-confs
16 echo "${cwd}/tmp/build" >/tmp/file-list
17 if test ! -d ${cwd}/tmp/build ; then
18 mkdir ${cwd}/tmp/build
20 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
22 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
23 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
28 echo " === Starting incremental-tape test ==="
29 echo " === Starting incremental-tape test ===" >>working/log
32 bin/bacula start 2>&1 >/dev/null
33 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
37 label storage=DDS-4 volume=TestVolume001 slot=0
38 run job=NightlySave yes
43 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
44 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
45 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
49 run level=Incremental job=NightlySave yes
56 restore where=${cwd}/tmp/bacula-restores storage=DDS-4
58 <${cwd}/tmp/restore-list
66 bin/bacula stop 2>&1 >/dev/null
67 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
69 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
72 # Delete .c files because we will only restored the txt files
75 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
76 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
79 echo " !!!!! incremental-tape test Bacula source failed!!! !!!!! "
80 echo " !!!!! incremental-tape test failed!!! !!!!! " >>test.out
83 echo " ===== incremental-tape test Bacula source OK ===== "
84 echo " ===== incremental-tape test OK ===== " >>test.out