Table of Contents Previous Next



The MANAGE subcommand is used to evaluate and categorize backups according to the retention policy set in the BART configuration file. When a backup is first created with the BACKUP subcommand, it always marked as active. Upon usage of the MANAGE subcommand, an active backup may be marked as obsolete. Obsolete backups can then be deleted.
Section 5.2.4.1 discusses the rules for deleting backups dependent upon the backup status and the subcommand used.
Section 5.2.4.2 shows how to retain a backup indefinitely by marking it as keep as well as resetting backups marked as obsolete and keep back to active status.
Section 5.2.4.3 demonstrates the general process for evaluating, marking, then deleting obsolete backups.
The MANAGE subcommand deletion relies solely upon how a backup status is currently marked (that is, internally recorded by BART). The current setting of the retention_policy parameter in the BART configuration file is ignored.
The DELETE subcommand relies solely upon the current setting of the retention_policy parameter in the BART configuration file. The current active, obsolete, or keep status of a backup is ignored.
Thus, the deletion behavior of the MANAGE subcommand and the DELETE subcommand are based on different aspects of the retention policy.
The specific deletion rules for the MANAGE and DELETE subcommands are as follows:
The MANAGE subcommand with the -d option can only delete backups marked as obsolete. This deletion occurs regardless of the current retention_policy setting in the BART configuration file.
Under a redundancy retention policy currently set with the retention_policy parameter in the BART configuration file, any backup regardless of its marked status, can be deleted with the DELETE subcommand when the backup identifier or name is specified with the -i option, and if the current total number of backups for the specified database server is greater than the maximum number of redundancy backups currently specified with the retention_policy parameter. If the total number of backups is less than or equal to the specified, maximum number of redundancy backups, then no additional backups can be deleted using DELETE with the -i backup option.
Under a recovery window retention policy currently set with the retention_policy parameter in the BART configuration file, any backup regardless of its marked status, can be deleted with the DELETE subcommand when the backup identifier or name is specified with the -i option, and if the backup date/time is not within the recovery window currently specified with the retention_policy parameter. If the backup date/time is within the recovery window, then it cannot be deleted using DELETE with the -i backup option.
Invoking the DELETE subcommand with the -i all option results in the deletion of all backups regardless of the retention policy and regardless of whether the status is marked as active, obsolete, or keep.
Note 1: Deletion occurs only if the total number of backups for the specified database server is greater than the specified, maximum number of redundancy backups currently set with the redundancy_policy parameter in the BART configuration file.
Note 2: Deletion occurs only if the backup is not within the recovery window currently set with the redundancy_policy parameter in the BART configuration file.
Use the MANAGE subcommand with the -c keep option to retain such backups indefinitely as shown by the following example:
The next time the MANAGE subcommand is invoked with either no options or with only the -s option, the active backup may be marked as obsolete according to the current retention_policy setting.
Based upon the current number of backups for the database server for a redundancy retention policy or the current date/time for a recovery window retention policy, when the MANAGE subcommand is invoked it evaluates active backups for the database server specified by the -s option or for all database servers if -s all is specified or the -s option is omitted.
Note: The status of backups currently marked as obsolete or keep are not changed. To re-evaluate such backups and then classify them, their status must first be reset back to active with the MANAGE -c nokeep option. See Section 5.2.2 for information.
Invoke the MANAGE subcommand with the -n option to perform a dry run to observe which active backups would be changed to obsolete according to the retention policy:
The dry run shows that backups 1428502049836 and 1428422324880 would be marked as obsolete.
Invoke the MANAGE subcommand omitting the -n option to change and mark the status of the backups as obsolete:
The obsolete backups can be observed in a number of ways. Use the MANAGE subcommand with the -l option to list the obsolete backups:
The STATUS field of the SHOW-BACKUPS subcommand displays the current status:
The details of an individual backup can be displayed using the SHOW-BACKUPS subcommand with the -t option. Note the status in the BACKUP STATUS field.
Use the MANAGE subcommand with the -d option to physically delete the obsolete backups including the unneeded WAL files.
The SHOW-BACKUPS subcommand now displays the remaining backups marked as active or keep:
Invoke the MANAGE subcommand with the -n option to perform a dry run to observe which active backups would be changed to obsolete according to the retention policy.
The dry run shows that backups 1428684544008 and 1428590536488 would be marked as obsolete.
Invoke the MANAGE subcommand omitting the -n option to change and mark the status of the backups as obsolete:
The obsolete backups can be observed in a number of ways. Use the MANAGE subcommand with the -l option to list the obsolete backups:
The STATUS field of the SHOW-BACKUPS subcommand displays the current status:
The details of an individual backup can be displayed using the SHOW-BACKUPS subcommand with the -t option. Note the status in the BACKUP STATUS field.
Use the MANAGE subcommand with the -d option to physically delete the obsolete backups including the unneeded WAL files.
The SHOW-BACKUPS subcommand now displays the remaining backups marked as active or keep:


Table of Contents Previous Next