3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do an Incremental and restore those two files.
8 scripts/copy-tape-confs
10 echo "${cwd}/tmp/build" >/tmp/file-list
11 if test ! -d ${cwd}/tmp/build ; then
12 mkdir ${cwd}/tmp/build
14 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
16 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
17 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
22 echo " === Starting incremental-tape test at `date +%R:%S` ==="
23 echo " === Starting incremental-tape test at `date +%R:%S` ===" >>working/log
26 bin/bacula start 2>&1 >/dev/null
27 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
31 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
32 run job=NightlySave yes
37 scripts/check_for_zombie_jobs storage=DDS-4
38 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
39 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
40 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
44 run level=Incremental job=NightlySave yes
51 restore where=${cwd}/tmp/bacula-restores storage=DDS-4
53 <${cwd}/tmp/restore-list
61 scripts/check_for_zombie_jobs storage=DDS-4
62 bin/bacula stop 2>&1 >/dev/null
63 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
65 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
68 # Delete .c files because we will only restored the txt files
71 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
72 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
75 echo " !!!!! incremental-tape test Bacula source failed!!! !!!!! "
76 echo " !!!!! incremental-tape test failed!!! !!!!! " >>test.out
79 echo " ===== incremental-tape test Bacula source OK ===== "
80 echo " ===== incremental-tape test OK ===== " >>test.out