Table of Contents Previous Next


3 Using BART : 3.2 Managing Backups Using a Retention Policy

1.
Determine and set a retention policy in the BART configuration file. A retention policy is a rule that determines when a backup is considered obsolete. The retention policy can be applied globally to all servers, but each server can override the global retention policy with its own (see the configuration section of EDB Postgres Backup and Recovery Installation and Upgrade Guide for details).
2.
Use the MANAGE subcommand to categorize and manage backups according to the retention policy. Such functionality includes determining which active backups should be considered obsolete at this current point in time, selecting backups to keep indefinitely, and physically deleting obsolete backups. When an obsolete backup is deleted, its backup taken with the BACKUP subcommand along with their backup’s archived WAL files are deleted.
3.
Once the retention policies have been determined and verified, you can create a cron job to periodically run the MANAGE subcommand to evaluate the backups and then list and/or delete the obsolete backups.
There is a difference on how retention policy management applies to incremental backups as compared to full backups. See Section 3.2.5 for information about how retention policy management applied to full backups affects incremental backups.
Section 3.2.1 provides an overview of the terminology and types of retention policies.
Section 3.2.2 describes the concept of marking the status of backups according to the retention policy.
Section 3.2.3 describes setting the different types of retention policies.
Section 3.2.4 describes the process of managing the backups such as marking the backup status, keeping selected backups indefinitely, listing obsolete backups, and deleting obsolete backups.
Note: The examples shown in the previously listed sections were generated with BART version 1.1. The retention policy management process is the same for the current BART version, however the displayed output of the SHOW-BACKUPS and SHOW-SERVERS subcommands now include a few additional fields that do not influence the retention policy.
3.2.1 Overview
Active. The backup satisfies the retention policy applicable to its server. Such backups would be considered necessary to ensure the recovery safety for the server and thus should be retained.
Obsolete. The backup does not satisfy the retention policy applicable to its server. The backup is no longer considered necessary for the recovery safety of the server and thus can be deleted.
Keep. The backup is to be retained regardless of the retention policy applicable to its server. The backup is considered vital to the recovery safety for the server and thus should not be deleted for an indefinite period of time.
Redundancy Retention Policy. The redundancy retention policy relies on a specified, maximum number of most recent backups to retain for a given server. When the number of backups exceeds that maximum number, the oldest backups are considered obsolete (except for backups marked as keep). Section 3.2.3.1 describes this type of retention policy.
Recovery Window Retention Policy. The recovery window retention policy relies on a time frame (the recovery window) for when a backup should be considered active. The boundaries defining the recovery window are the current date/time (the ending boundary of the recovery window) and the date/time going back in the past for a specified length of time (the starting boundary of the recovery window). If the date/time the backup was taken is within the recovery window (that is, the backup date/time is on or after the starting date/time of the recovery window), then the backup is considered active, otherwise it is considered obsolete (except for backups marked as keep). Section 3.2.3.2 describes this type of retention policy.
Thus, for the recovery window retention policy, the recovery window time frame dynamically shifts, so the end of the recovery window is always the current date/time when the MANAGE subcommand is run. As you run the MANAGE subcommand at future points in time, the starting boundary of the recovery window moves forward in time.
You can see the starting boundary of the recovery window at any point in time by running the SHOW-SERVERS subcommand. The RETENTION POLICY field of the SHOW-SERVERS subcommand displays the starting boundary of the recovery window.

3 Using BART : 3.2 Managing Backups Using a Retention Policy

Table of Contents Previous Next