Job Statistics

If you want to have statistics on your backups to provide some SLA indicators, you could use a few SQL queries on the table to report how many:

  • jobs have run

  • jobs have been successful

  • files have been backed up

  • and so on.

However, these statistics are accurate only if your job retention is greater than your statistics period, i.e, if jobs are purged from the catalog, you won’t be able to use them.

Since the introduction of the jobhisto catalog DB table, you can use the update stats [days=num] console command to fill this table with new Job records. If you want to be sure to take in account only good jobs, e.g. if one of your important job has failed but you have fixed the problem and restarted it on time, you probably want to delete the first bad job record and keep only the successful one. For that simply let your staff do the job, and update table after two or three days depending on your organization using the [days=num] option.

These statistics records aren’t used for restoring, but mainly for capacity planning, billings, etc.

The BWeb interface provides a statistics module that can use this feature. You can also use third party tools (like Talend) or extract information by yourself.

The Statistics Retention = Director directive defines the length of time that Bacula will keep statistics job records in the Catalog database after the Job End time. When this time period expires, and if user runs prune stats command, Bacula will prune (remove) Job records that are older than the specified period.

For example, you can use the following RunScript console commands in your nightly BackupCatalog job to maintain statistics.

Job {
    Name = BackupCatalog
    ...
    RunScript {
        Console = "update stats days=3"
        Console = "prune stats yes"
        RunsWhen = After
        RunsOnClient = no
        }
    }

Go back to Using Bacula Catalog to Grab Information.

Go back to the Jobs Monitoring chapter.

Go back to the main Bacula Enterprise Management page.