Sorry for jumping in late, but was on vacation.
I use the attached script, which I modified from a script posted by Jonas Björklund. You'll need to modify it to add your database values and email specifics (if you want to lock them into the perl script). If you see something wrong, please tell me. It produces output like this:
======== Start of Sample Output ========
Total 5 jobs - 4 jobs are OK
Total 12.2 GB / 877 files
0 jobs are waiting
Status JobName Lvl MBytes/Files Start Time KB/s Pool
======================================================================================
E SI-Marge F 0/0 08.20 19:00 6.0m 0 Full
T BackupCatalog F 2021/1 08.20 23:19 4.9m 11894 Catalog
T Chernobog I 296/133 08.20 21:00 14.6m 667 SIncr
T SI-Nvivo I 2679/336 08.20 20:00 10.9m 7685 Incr
T SI-Homer I 7454/407 08.20 19:00 134.1m 1895 SBIncr
======================================================================================
Status codes:
T Terminated normally
A Canceled by the user
B Blocked
C Created but not yet running
D Verify Differences
E Terminated in Error
F Waiting on the File daemon
M Waiting for a Mount
R Running
S Waiting on the Storage daemon
c Waiting for Client resource
d Waiting for Maximum jobs
e Non-fatal error
f Fatal error
j Waiting for Job resource
m Waiting for a new Volume to be mounted
p Waiting for higher priority job to finish
s Waiting for Storage resource
t Waiting for Start Time
======== End of Sample Output ========
I run this via cron from my /etc/cron.daily directory using the following script:
#!/bin/sh
# Generate Daily Bacula Reports
SCRIPT='/usr/local/bacula-scripts/
report.pl'
VARIABLES='-wT'
test -x ${SCRIPT} || exit 0
${SCRIPT} ${VARIABLES}