1BARMAN-CLOUD-BACKUP-DELETE(1) Version 3.0.1 BARMAN-CLOUD-BACKUP-DELETE(1)
2
3
4
6 barman-cloud-backup-delete - Delete backups stored in the Cloud
7
9 barman-cloud-backup-delete [OPTIONS] SOURCE_URL SERVER_NAME
10
12 This script can be used to delete backups previously made with the bar‐
13 man-cloud-backup command. Currently AWS S3, Azure Blob Storage and
14 Google Cloud Storage are supported.
15
16 The target backups can be specified either using the backup ID (as re‐
17 turned by barman-cloud-backup-list) or by retention policy. Retention
18 policies are the same as those for Barman server and work as described
19 in the Barman manual: all backups not required to meet the specified
20 policy will be deleted.
21
22 When a backup is successfully deleted any unused WALs associated with
23 that backup are removed. WALs are only considered unused if:
24
25 1. There are no older backups than the deleted backup or all older
26 backups are archival backups.
27
28 2. The WALs pre-date the begin_wal value of the oldest remaining back‐
29 up.
30
31 3. The WALs are not required by any archival backups present in cloud
32 storage.
33
34 Note: The deletion of each backup involves three separate delete re‐
35 quests to the cloud provider (once for the backup files, once for the
36 backup.info file and once for any associated WALs). If you have a sig‐
37 nificant number of backups accumulated in cloud storage then deleting
38 by retention policy could result in a large number of delete requests.
39
40 This script and Barman are administration tools for disaster recovery
41 of PostgreSQL servers written in Python and maintained by EnterpriseDB.
42
44 SOURCE_URL
45 URL of the cloud source, such as a bucket in AWS S3. For exam‐
46 ple: s3://BUCKET_NAME/path/to/folder (where BUCKET_NAME is the
47 bucket you have created in AWS).
48
49 SERVER_NAME
50 the name of the server as configured in Barman.
51
53 -h, –help
54 show a help message and exit
55
56 -V, –version
57 show program's version number and exit
58
59 -v, –verbose
60 increase output verbosity (e.g., -vv is more than -v)
61
62 -q, –quiet
63 decrease output verbosity (e.g., -qq is less than -q)
64
65 -t, –test
66 test connectivity to the cloud destination and exit
67
68 -b BACKUP_ID, –backup-id BACKUP_ID
69 a valid Backup ID for a backup in cloud storage which is to be
70 deleted
71
72 -r RETENTION_POLICY, –retention-policy RETENTION_POLICY
73 used instead of –backup-id, a retention policy for selecting the
74 backups to be deleted, e.g. “REDUNDANCY 3” or “RECOVERY WINDOW
75 OF 2 WEEKS”
76
77 –dry-run
78 run without actually deleting any objects while printing infor‐
79 mation about the objects which would be deleted to stdout
80
81 –cloud-provider {aws-s3,azure-blob-storage,google-cloud-storage}
82 the cloud provider to which the backup should be uploaded
83
84 -P, –profile
85 profile name (e.g. INI section in AWS credentials file)
86
87 –endpoint-url
88 override the default S3 URL construction mechanism by specifying
89 an endpoint.
90
91 –credential {azure-cli,managed-identity}
92 optionally specify the type of credential to use when authenti‐
93 cating with Azure Blob Storage. If omitted then the credential
94 will be obtained from the environment. If no credentials can be
95 found in the environment then the default Azure authentication
96 flow will be used.
97
99 For Boto:
100
101 • https://boto3.amazonaws.com/v1/documentation/api/latest/guide/config‐
102 uration.html
103
104 For AWS:
105
106 • https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-get‐
107 ting-set-up.html
108
109 • https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-get‐
110 ting-started.html.
111
112 For Azure Blob Storage:
113
114 • https://docs.microsoft.com/en-us/azure/storage/blobs/authorize-da‐
115 ta-operations-cli#set-environment-variables-for-authorization-parame‐
116 ters
117
118 • https://docs.microsoft.com/en-us/python/api/azure-stor‐
119 age-blob/?view=azure-python
120
121 For Google Cloud Storage: * Credentials:
122 https://cloud.google.com/docs/authentication/getting-started#set‐
123 ting_the_environment_variable
124
125 Only authentication with GOOGLE_APPLICATION_CREDENTIALS env is support‐
126 ed at the moment.
127
129 If using --cloud-provider=aws-s3:
130
131 • boto3
132
133 If using --cloud-provider=azure-blob-storage:
134
135 • azure-storage-blob
136
137 • azure-identity (optional, if you wish to use DefaultAzureCredential)
138
139 If using --cloud-provider=google-cloud-storage * google-cloud-storage
140
142 0 Success
143
144 1 The delete operation was not successful
145
146 2 The connection to the cloud provider failed
147
148 3 There was an error in the command input
149
150 Other non-zero codes
151 Failure
152
154 Barman has been extensively tested, and is currently being used in sev‐
155 eral production environments. However, we cannot exclude the presence
156 of bugs.
157
158 Any bug can be reported via the Github issue tracker.
159
161 • Homepage: <https://www.pgbarman.org/>
162
163 • Documentation: <https://docs.pgbarman.org/>
164
165 • Professional support: <https://www.enterprisedb.com/>
166
168 Barman is the property of EnterpriseDB UK Limited and its code is dis‐
169 tributed under GNU General Public License v3.
170
171 © Copyright EnterpriseDB UK Limited 2011-2022
172
174 EnterpriseDB <https://www.enterprisedb.com>.
175
176
177
178Barman User manuals June 27, 2022 BARMAN-CLOUD-BACKUP-DELETE(1)