You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -794,6 +800,7 @@ Detailed output has additional attributes:
794
800
- program-version — full version of pg_probackup binary used to create backup.
795
801
- start-time — the backup starting time.
796
802
- end-time — the backup ending time.
803
+
- expire-time — if the backup was pinned, then until this point in time the backup cannot be removed by retention purge.
797
804
- uncompressed-bytes — size of the data files before adding page headers and applying compression. You can evaluate the effectiveness of compression by comparing 'uncompressed-bytes' to 'data-bytes' if compression if used.
798
805
- pgdata-bytes — size of the PostgreSQL cluster data files at the time of backup. You can evaluate the effectiveness of incremental backup by comparing 'pgdata-bytes' to 'uncompressed-bytes'.
799
806
- recovery-xid — current transaction id at the moment of backup ending.
@@ -1171,6 +1178,42 @@ BACKUP INSTANCE 'node'
1171
1178
1172
1179
>NOTE: The Time field for the merged backup displays the time required for the merge.
1173
1180
1181
+
#### Pinning a Backup
1182
+
1183
+
If you have the necessity to exclude certain backups from established retention policy then it is possible to pin a backup for an arbitrary amount of time. Example:
This command will set `expire-time` of specified backup to 30 days starting from backup `recovery-time` attribute. Basically 'expire-time = recovery-time + ttl'.
1188
+
1189
+
You can set `expire-time` explicitly using `--expire-time` option. Example:
Alternatively you can use the `--ttl` and `--expire-time` options with the [backup](#backup) command to pin newly created backup:
1194
+
1195
+
pg_probackup backup -B backup_dir --instance instance_name -b FULL --ttl=30d
1196
+
pg_probackup backup -B backup_dir --instance instance_name -b FULL --expire-time='2020-01-01 00:00:00+03'
1197
+
1198
+
You can determine the fact that backup is pinned and check due expire time by looking up 'expire-time' attribute in backup metadata via (show)[#show] command:
1199
+
1200
+
pg_probackup show --instance instance_name -i backup_id
1201
+
1202
+
Pinned backup has `expire-time` attribute:
1203
+
```
1204
+
...
1205
+
recovery-time = '2017-05-16 12:57:31'
1206
+
expire-time = '2020-01-01 00:00:00+03'
1207
+
data-bytes = 22288792
1208
+
...
1209
+
```
1210
+
1211
+
You can unpin a backup by setting `--ttl` option to zero using `set-backup` command. Example:
Only pinned backups have `expire-time` attribute in backup metadata.
1216
+
1174
1217
### Merging Backups
1175
1218
1176
1219
As you take more and more incremental backups, the total size of the backup catalog can substantially grow. To save disk space, you can merge incremental backups to their parent full backup by running the merge command, specifying the backup ID of the most recent incremental backup you would like to merge:
@@ -1267,6 +1310,15 @@ For all available settings, see the [Options](#options) section.
1267
1310
1268
1311
It is **not recommended** to edit pg_probackup.conf manually.
Creates a backup copy of the PostgreSQL instance. The *backup_mode* option specifies the backup mode to use.
1302
1354
@@ -1342,7 +1394,7 @@ Disables block-level checksum verification to speed up backup.
1342
1394
--no-validate
1343
1395
Skips automatic validation after successfull backup. You can use this flag if you validate backups regularly and would like to save time when running backup operations.
1344
1396
1345
-
Additionally [Connection Options](#connection-options), [Retention Options](#retention-options), [Remote Mode Options](#remote-mode-options), [Compression Options](#compression-options), [Logging Options](#logging-options) and [Common Options](#common-options) can be used.
1397
+
Additionally [Connection Options](#connection-options), [Retention Options](#retention-options), [Pinning Options](#pinning-options), [Remote Mode Options](#remote-mode-options), [Compression Options](#compression-options), [Logging Options](#logging-options) and [Common Options](#common-options) can be used.
1346
1398
1347
1399
For details on usage, see the section [Creating a Backup](#creating-a-backup).
1348
1400
@@ -1565,6 +1617,18 @@ Merges the oldest incremental backup that satisfies the requirements of retentio
1565
1617
--dry-run
1566
1618
Displays the current status of all the available backups, without deleting or merging expired backups, if any.
1567
1619
1620
+
##### Pinning Options
1621
+
1622
+
You can use these options together with [backup](#backup) and [set-delete](#set-backup) commands.
1623
+
1624
+
For details on backup pinning, see the section [Pinning a Backup](#pinning-a-backup).
1625
+
1626
+
--ttl=ttl
1627
+
Specifies the amount of time the backup should be pinned. Must be a positive integer. The zero value unpin already pinned backup. Supported units: ms, s, min, h, d (s by default). Example: `--ttl=30d`.
1628
+
1629
+
--expire-time=time
1630
+
Specifies the timestamp up to which the backup will stay pinned. Must be a ISO-8601 complaint timestamp. Example: `--expire-time='2020-01-01 00:00:00+03'`
0 commit comments