3 # Run a simple backup of the Bacula build directory
4 # prune file records, then restore only README files.
6 TestName="fileregexp-test"
14 # Zap out any schedule in default conf file so that
15 # it doesn't start during our test
18 echo "s% Schedule =%# Schedule =%g" >${outf}
19 echo "s%File Retention =%File Retention = 2 #%" >> ${outf}
20 cp ${scripts}/bacula-dir.conf ${tmp}/1
21 sed -f ${outf} ${tmp}/1 >${scripts}/bacula-dir.conf
23 change_jobname BackupClient1 $JobName
26 cat <<END_OF_DATA >${tmp}/bconcmds
30 label volume=TestVolume001 storage=File pool=File
43 cat <<END_OF_DATA >${tmp}/bconcmds
51 restore where=${tmp}/bacula-restores
62 check_for_zombie_jobs storage=File
66 # The above restore should have restored some directories, but only
67 # files that have README in their name. There should in fact, be
68 # no other files restored COUNT_OTHER==0 and 13 README files restored.
69 # We complain if there are less than 11
71 COUNT_OTHER=`find ${tmp}/bacula-restores -type f | grep -v README | wc -l`
72 COUNT_README=`find ${tmp}/bacula-restores -type f | grep README | wc -l`
74 if [ $COUNT_OTHER -gt 0 -o $COUNT_README -lt 11 ]; then
75 print_debug "Found non matching files"
76 print_debug "Count_other=$COUNT_OTHER count_readme=$COUNT_README"
77 print_debug `find ${tmp}/bacula-restores -type f | grep -v README`
81 #check_two_logs # don't work because of "warning file count mismatch"
82 grep "Backup OK" ${tmp}/log1.out > /dev/null
84 print_debug "Found error in backup"