Backup check – pg_dump


Job details

Name: Backup check – pg_dump
Platform: Postgres
Category: Availability
Description: Checks that there exists an up to date backup file.
Long description: Checks that there exists an up to date backup file.
Version: 1.6
Default schedule: 10 06 * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘postgres’]/.[hasengine=‘YES’ & is_awsrds = ‘0′ & newer_than_ninefour = 1]

Parameters

Name Default value Description
backup catalog CHANGE_THIS The directory containing the backup files (relative path).
alarm period 96 Will give an alarm if the number of hours since the last backup exceeds this limit.
warning period 48 Will give a warning if the number of hours since the last backup exceeds this limit.

Job Summary

select bck_filename as "Backup file", backup_date as "Modified date", status as "Status"  from dbw_backup_check_data order by backup_date desc;

Monitoring Details

This monitoring job is designed specifically for PostgreSQL databases that are instances running with a version newer than 9.4, excluding AWS RDS instances. The job uses PostgreSQL features like ‘pg_ls_dir’ and ‘pg_stat_file’ for inspecting the backup directory.

Implementation Details

Dependency Details

Database Tables and Procedures

Table/Procedure Name Description
dbw_backup_check_data Holds details of each backup file like filename, backup timestamp, and file size.
dbw_backup_check_dir Stores the directory path where backup files are located.
dbw_backup_check Main procedure that reads file details, validates backup integrity, and updates the system based on findings.

Reporting Details

The reporting generated by this job provides:

This report is essential for database administrators to ensure backups are occurring as scheduled and are stored correctly.