1
\chapter{Using Bacula catalog to grab information}
2
\label{UseBaculaCatalogToExtractInformationChapter}
3
\index[general]{Statistics}
5
Bacula catalog contains lot of information about your IT infrastructure, how
6
many files, their size, the number of video or music files etc. Using Bacula
7
catalog during the day to get them permit to save resources on your servers.
9
In this chapter, you will find tips and information to measure bacula
10
efficiency and report statistics.
12
\section{Job statistics}
13
If you (or probably your boss) want to have statistics on your backups to
14
provide some \textit{Service Level Agreement} indicators, you could use a few
15
SQL queries on the Job table to report how many:
19
\item jobs have been successful
20
\item files have been backed up
24
However, these statistics are accurate only if your job retention is greater
25
than your statistics period. Ie, if jobs are purged from the catalog, you won't
28
Now, you can use the \textbf{update stats [days=num]} console command to fill
29
the JobHistory table with new Job records. If you want to be sure to take in
30
account only \textbf{good jobs}, ie if one of your important job has failed but
31
you have fixed the problem and restarted it on time, you probably want to
32
delete the first \textit{bad} job record and keep only the successful one. For
33
that simply let your staff do the job, and update JobHistory table after two or
34
three days depending on your organization using the \textbf{[days=num]} option.
36
These statistics records aren't used for restoring, but mainly for
37
capacity planning, billings, etc.
39
The Bweb interface provides a statistics module that can use this feature. You
40
can also use tools like Talend or extract information by yourself.
42
The \textbf{Statistics Retention = \lt{}time\gt{}} director directive defines
43
the length of time that Bacula will keep statistics job records in the Catalog
44
database after the Job End time. (In \texttt{JobHistory} table) When this time
45
period expires, and if user runs \texttt{prune stats} command, Bacula will
46
prune (remove) Job records that are older than the specified period.
48
You can use the following Job resource in your nightly \textbf{BackupCatalog}
49
job to maintain statistics.
55
Console = "update stats days=3"
56
Console = "prune stats yes"