Skip to content

Commit 8f9861d

Browse files
committed
Documentation: update 'Configuring Backup Retention Policy' section
1 parent 0e4d9fc commit 8f9861d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Documentation.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ Current version - 2.1.5
102102

103103
`pg_probackup merge -B backup_dir --instance instance_name -i backup_id [option...]`
104104

105-
`pg_probackup delete -B backup_dir --instance instance_name { -i backup_id | --delete-wal | --delete-expired | --merge-expired }`
105+
`pg_probackup delete -B backup_dir --instance instance_name { -i backup_id | --delete-wal | --delete-expired | --merge-expired } [option...]`
106106

107107
`pg_probackup archive-push -B backup_dir --instance instance_name --wal-file-path=wal_file_path --wal-file-name=wal_file_name [option...]`
108108

109-
`pg_probackup archive-get -B backup_dir --instance instance_name --wal-file-path=wal_file_path --wal-file-name=wal_file_name`
109+
`pg_probackup archive-get -B backup_dir --instance instance_name --wal-file-path=wal_file_path --wal-file-name=wal_file_name [option...]`
110110

111111

112112
## Versioning
@@ -1070,7 +1070,9 @@ Specifies **the number of full backup copies** to keep in the backup catalog.
10701070
--retention-window=window
10711071
Defines the earliest point in time for which pg_probackup can complete the recovery. This option is set in **the number of days** from the current moment. For example, if `retention-window=7`, pg_probackup must delete all backup copies that are older than seven days, with all the corresponding WAL files.
10721072

1073-
If both `--retention-redundancy` and `--retention-window` options are set, pg_probackup keeps backup copies that satisfy at least one condition. For example, if you set `--retention-redundancy=2` and `--retention-window=7`, pg_probackup purges the backup catalog to keep only two full backup copies and all backups that are newer than seven days.
1073+
If both `--retention-redundancy` and `--retention-window` options are set, pg_probackup keeps backup copies that satisfy at least one condition. For example, if you set `--retention-redundancy=2` and `--retention-window=7`, pg_probackup purges the backup catalog to keep only two full backup copies and all backups that are newer than seven days:
1074+
1075+
pg_probackup set-config -B backup_dir --instance instance_name --retention-redundancy=2 --retention-window=7
10741076

10751077
To clean up the backup catalog in accordance with retention policy, run:
10761078

@@ -1084,6 +1086,10 @@ If you would like to also remove the WAL files that are no longer required for a
10841086

10851087
>NOTE: Alternatively, you can use the `--delete-expired`, `--merge-expired`, `--delete-wal` flags and the `--retention-window` and `--retention-redundancy` options together with the [backup](#backup) command to remove and merge the outdated backup copies once the new backup is created.
10861088
1089+
You can set or override the current retention policy by specifying `--retention-redundancy` and `--retention-window` options directly when running `delete` or `backup` commands:
1090+
1091+
pg_probackup delete -B backup_dir --instance instance_name --delete-expired --retention-window=7 --retention-redundancy=2
1092+
10871093
Since incremental backups require that their parent full backup and all the preceding incremental backups are available, if any of such backups expire, they still cannot be removed while at least one incremental backup in this chain satisfies the retention policy. To avoid keeping expired backups that are still required to restore an active incremental one, you can merge them with this backup using the `--merge-expired` flag when running [backup](#backup) or [delete](#delete) commands.
10881094

10891095
Suppose you have backed up the *node* instance in the *backup_dir* directory, with the `--retention-window` option is set to *7*, and you have the following backups available on April 10, 2019:
@@ -1380,6 +1386,7 @@ For details, see the section [Merging Backups](#merging-backups).
13801386

13811387
pg_probackup delete -B backup_dir --instance instance_name
13821388
[--help] [-j num_threads] [--progress]
1389+
[--retention-redundancy=redundancy][--retention-window=window]
13831390
[--delete-wal] {-i backup_id | --delete-expired [--merge-expired] | --merge-expired}
13841391
[--dry-run]
13851392
[logging_options]

0 commit comments

Comments
 (0)