mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-01-05 13:20:31 +02:00
Updated documentation and test for --status option of delete command
This commit is contained in:
parent
a365520a1c
commit
98c22cae46
@ -3229,10 +3229,10 @@ pg_probackup delete -B <replaceable>backup_dir</replaceable> --instance <replace
|
||||
policy, without performing any irreversible actions.
|
||||
</para>
|
||||
<para>
|
||||
To delete backups with the ERROR status, use the <option>--error-state</option> flag:
|
||||
To delete all backups with some status, use the <option>--status</option>:
|
||||
</para>
|
||||
<programlisting>
|
||||
pg_probackup delete -B <replaceable>backup_dir</replaceable> --instance <replaceable>instance_name</replaceable> --error-state
|
||||
pg_probackup delete -B <replaceable>backup_dir</replaceable> --instance <replaceable>instance_name</replaceable> --status=ERROR
|
||||
</programlisting>
|
||||
|
||||
</refsect2>
|
||||
@ -3869,7 +3869,7 @@ pg_probackup merge -B <replaceable>backup_dir</replaceable> --instance <replacea
|
||||
pg_probackup delete -B <replaceable>backup_dir</replaceable> --instance <replaceable>instance_name</replaceable>
|
||||
[--help] [-j <replaceable>num_threads</replaceable>] [--progress]
|
||||
[--retention-redundancy=<replaceable>redundancy</replaceable>][--retention-window=<replaceable>window</replaceable>][--wal-depth=<replaceable>wal_depth</replaceable>]
|
||||
[--delete-wal] {-i <replaceable>backup_id</replaceable> | --delete-expired [--merge-expired] | --merge-expired | --error-state}
|
||||
[--delete-wal] {-i <replaceable>backup_id</replaceable> | --delete-expired [--merge-expired] | --merge-expired | --status= }
|
||||
[--dry-run]
|
||||
[<replaceable>logging_options</replaceable>]
|
||||
</programlisting>
|
||||
|
16
src/util.c
16
src/util.c
@ -488,22 +488,6 @@ BackupStatus
|
||||
str2status(const char *status)
|
||||
{
|
||||
|
||||
/* static const char *statusName[] =
|
||||
{
|
||||
"UNKNOWN",
|
||||
"OK",
|
||||
"ERROR",
|
||||
"RUNNING",
|
||||
"MERGING",
|
||||
"MERGED",
|
||||
"DELETING",
|
||||
"DELETED",
|
||||
"DONE",
|
||||
"ORPHAN",
|
||||
"CORRUPT"
|
||||
};*/
|
||||
|
||||
|
||||
for (int i = 0; i <= BACKUP_STATUS_CORRUPT; i++)
|
||||
{
|
||||
if (pg_strcasecmp(status, statusName[i]) == 0) return i;
|
||||
|
@ -835,7 +835,7 @@ class DeleteTest(ProbackupTest, unittest.TestCase):
|
||||
self.assertEqual(len(show_backups), 4)
|
||||
|
||||
# delete error backups
|
||||
self.delete_pb(backup_dir, 'node', options=['--error-state'])
|
||||
self.delete_pb(backup_dir, 'node', options=['--status=ERROR'])
|
||||
|
||||
print(self.show_pb(backup_dir, as_text=True, as_json=False))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user