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
11 scripts/copy-tape-confs
13 echo "${cwd}/tmp/build" >/tmp/file-list
14 if test ! -d ${cwd}/tmp/build ; then
15 mkdir ${cwd}/tmp/build
17 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
19 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
20 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
25 echo " === Starting incremental-tape test ==="
26 echo " === Starting incremental-tape test ===" >>working/log
29 bin/bacula start 2>&1 >/dev/null
30 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
34 label storage=DDS-4 volume=TestVolume001 slot=0
35 run job=NightlySave yes
40 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
41 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
42 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
46 run level=Incremental job=NightlySave yes
53 restore where=${cwd}/tmp/bacula-restores
55 <${cwd}/tmp/restore-list
63 bin/bacula stop 2>&1 >/dev/null
64 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
66 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
69 # Delete .c files because we will only restored the txt files
72 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
73 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
76 echo " !!!!! incremental-tape test Bacula source failed!!! !!!!! "
77 echo " !!!!! incremental-tape test failed!!! !!!!! " >>test.out
80 echo " ===== incremental-tape test Bacula source OK ===== "
81 echo " ===== incremental-tape test OK ===== " >>test.out