3 # Run a simple backup of the Bacula build directory but
4 # create three volumes and do six backups causing the
5 # volumes to be recycled, and cycling through the volumes
6 # twice. Tests maxvoljobs and volretention.
9 scripts/copy-test-confs
11 echo "${cwd}/build" >/tmp/file-list
15 echo " === Starting recycle-test at `date +%R:%S` ==="
16 echo " === Starting recycle-test at `date +%R:%S` ===" >working/log
19 #bin/bacula start 2>&1 >/dev/null
21 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
24 label storage=File1 volume=TestVolume001
25 label storage=File1 volume=TestVolume002
26 label storage=File1 volume=TestVolume003
27 update Volume=TestVolume001 volretention=10s
28 update Volume=TestVolume001 maxvoljobs=1
29 update Volume=TestVolume002 volretention=10s
30 update Volume=TestVolume002 maxvoljobs=1
31 update Volume=TestVolume003 volretention=10s
32 update Volume=TestVolume003 maxvoljobs=1
34 run job=NightlySave storage=File1 level=full yes
38 run job=NightlySave storage=File1 level=full yes
42 run job=NightlySave storage=File1 level=full yes
47 run job=NightlySave storage=File1 level=full yes
51 run job=NightlySave storage=File1 level=full yes
56 run job=NightlySave storage=File1 level=full yes
64 restore where=${cwd}/tmp/bacula-restores select storage=File1
74 scripts/check_for_zombie_jobs storage=File1
75 bin/bacula stop 2>&1 >/dev/null
76 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
78 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
80 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
81 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
84 echo " !!!!! recycle-test Bacula source failed!!! !!!!! "
85 echo " !!!!! recycle-test failed!!! !!!!! " >>test.out
86 if [ $bstat != 0 -o $rstat != 0 ] ; then
87 echo " !!!!! Bad Job termination status !!!!! "
88 echo " !!!!! Bad Job termination status !!!!! " >>test.out
90 echo " !!!!! Restored files differ !!!!! "
91 echo " !!!!! Restored files differ !!!!! " >>test.out
95 echo " ===== recycle-test Bacula source OK ===== "
96 echo " ===== recycle-test OK ===== " >>test.out