Skip to content

Commit 271d2d1

Browse files
committed
Merge branch 'master' into wal_delete_refactoring
2 parents 1d34fd8 + af50ddf commit 271d2d1

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
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]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ gen_probackup_project.pl C:\path_to_postgresql_source_tree
114114

115115
Currently the latest documentation can be found at [github](https://postgrespro.github.io/pg_probackup).
116116
Slightly outdated documentation can be found at [Postgres Pro Enterprise documentation](https://postgrespro.com/docs/postgrespro/current/app-pgprobackup).
117+
Documentation for current devel can also be found at [github](https://github.com/postgrespro/pg_probackup/blob/master/Documentation.md)
117118

118119
## License
119120

src/help.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ help_pg_probackup(void)
170170
printf(_(" [--help]\n"));
171171

172172
printf(_("\n %s delete -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
173-
printf(_(" [--wal] [-i backup-id | --expired | --merge-expired]\n"));
173+
printf(_(" [-j num-threads] [--progress]\n"));
174+
printf(_(" [--retention-redundancy=retention-redundancy]\n"));
175+
printf(_(" [--retention-window=retention-window]\n"));
176+
printf(_(" [--delete-wal] [-i backup-id | --delete-expired | --merge-expired]\n"));
174177
printf(_(" [--dry-run]\n"));
175178
printf(_(" [--help]\n"));
176179

@@ -300,7 +303,7 @@ help_backup(void)
300303
printf(_(" retention policy after successful backup completion\n"));
301304
printf(_(" --merge-expired merge backups expired according to current\n"));
302305
printf(_(" retention policy after successful backup completion\n"));
303-
printf(_(" --delete-wal remove redundant archived wal files\n"));
306+
printf(_(" --delete-wal remove redundant wal files in WAL archive\n"));
304307
printf(_(" --retention-redundancy=retention-redundancy\n"));
305308
printf(_(" number of full backups to keep; 0 disables; (default: 0)\n"));
306309
printf(_(" --retention-window=retention-window\n"));
@@ -556,18 +559,27 @@ static void
556559
help_delete(void)
557560
{
558561
printf(_("\n%s delete -B backup-path --instance=instance_name\n"), PROGRAM_NAME);
559-
printf(_(" [-i backup-id | --expired | --merge-expired] [--wal]\n"));
560-
printf(_(" [-j num-threads] [--dry-run]\n\n"));
562+
printf(_(" [-i backup-id | --delete-expired | --merge-expired] [--delete-wal]\n"));
563+
printf(_(" [-j num-threads] [--progress]\n"));
564+
printf(_(" [--retention-redundancy=retention-redundancy]\n"));
565+
printf(_(" [--retention-window=retention-window]\n\n"));
561566

562567
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
563568
printf(_(" --instance=instance_name name of the instance\n"));
564569
printf(_(" -i, --backup-id=backup-id backup to delete\n"));
565-
printf(_(" --expired delete backups expired according to current\n"));
570+
printf(_(" -j, --threads=NUM number of parallel threads\n"));
571+
printf(_(" --progress show progress\n"));
572+
573+
printf(_("\n Retention options:\n"));
574+
printf(_(" --delete-expired delete backups expired according to current\n"));
566575
printf(_(" retention policy\n"));
567576
printf(_(" --merge-expired merge backups expired according to current\n"));
568577
printf(_(" retention policy\n"));
569-
printf(_(" --wal remove unnecessary wal files in WAL ARCHIVE\n"));
570-
printf(_(" -j, --threads=NUM number of parallel threads\n"));
578+
printf(_(" --delete-wal remove redundant wal files in WAL archive\n"));
579+
printf(_(" --retention-redundancy=retention-redundancy\n"));
580+
printf(_(" number of full backups to keep; 0 disables; (default: 0)\n"));
581+
printf(_(" --retention-window=retention-window\n"));
582+
printf(_(" number of days of recoverability; 0 disables; (default: 0)\n"));
571583
printf(_(" --dry-run perform a trial run without any changes\n"));
572584

573585
printf(_("\n Logging options:\n"));

0 commit comments

Comments
 (0)