1BARMAN-CLOUD-BACKUP-DELETE(1)    Version 3.9.0   BARMAN-CLOUD-BACKUP-DELETE(1)
2
3
4

NAME

6       barman-cloud-backup-delete - Delete backups stored in the Cloud
7

SYNOPSIS

9       barman-cloud-backup-delete [OPTIONS] SOURCE_URL SERVER_NAME
10

DESCRIPTION

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

Usage

44              usage: barman-cloud-backup-delete [-V] [--help] [-v | -q] [-t]
45                                                [--cloud-provider {aws-s3,azure-blob-storage,google-cloud-storage}]
46                                                [--endpoint-url ENDPOINT_URL]
47                                                [-P AWS_PROFILE] [--profile AWS_PROFILE]
48                                                [--read-timeout READ_TIMEOUT]
49                                                [--azure-credential {azure-cli,managed-identity}
50                                                [-b BACKUP_ID] [-m MINIMUM_REDUNDANCY]
51                                                [-r RETENTION_POLICY] [--dry-run]
52                                                [--batch-size DELETE_BATCH_SIZE]
53                                                source_url server_name
54
55              This script can be used to delete backups made with barman-cloud-backup
56              command. Currently AWS S3, Azure Blob Storage and Google Cloud Storage are
57              supported.
58
59              positional arguments:
60                source_url            URL of the cloud source, such as a bucket in AWS S3.
61                                      For example: `s3://bucket/path/to/folder`.
62                server_name           the name of the server as configured in Barman.
63
64              optional arguments:
65                -V, --version         show program's version number and exit
66                --help                show this help message and exit
67                -v, --verbose         increase output verbosity (e.g., -vv is more than -v)
68                -q, --quiet           decrease output verbosity (e.g., -qq is less than -q)
69                -t, --test            Test cloud connectivity and exit
70                --cloud-provider {aws-s3,azure-blob-storage,google-cloud-storage}
71                                      The cloud provider to use as a storage backend
72                -b BACKUP_ID, --backup-id BACKUP_ID
73                                      Backup ID of the backup to be deleted
74                -m MINIMUM_REDUNDANCY, --minimum-redundancy MINIMUM_REDUNDANCY
75                                      The minimum number of backups that should always be available.
76                -r RETENTION_POLICY, --retention-policy RETENTION_POLICY
77                                      If specified, delete all backups eligible for deletion
78                                      according to the supplied retention policy. Syntax:
79                                      REDUNDANCY value | RECOVERY WINDOW OF value {DAYS |
80                                      WEEKS | MONTHS}
81                --dry-run             Find the objects which need to be deleted but do not
82                                      delete them
83                --batch-size DELETE_BATCH_SIZE
84                                      The maximum number of objects to be deleted in a
85                                      single request to the cloud provider. If unset then
86                                      the maximum allowed batch size for the specified cloud
87                                      provider will be used (1000 for aws-s3, 256 for azure-
88                                      blob-storage and 100 for google-cloud-storage).
89
90              Extra options for the aws-s3 cloud provider:
91                --endpoint-url ENDPOINT_URL
92                                      Override default S3 endpoint URL with the given one
93                -P AWS_PROFILE, --aws-profile AWS_PROFILE
94                                      profile name (e.g. INI section in AWS credentials
95                                      file)
96                --profile AWS_PROFILE
97                                      profile name (deprecated: replaced by --aws-profile)
98                --read-timeout READ_TIMEOUT
99                                      the time in seconds until a timeout is raised when
100                                      waiting to read from a connection (defaults to 60
101                                      seconds)
102
103              Extra options for the azure-blob-storage cloud provider:
104                --azure-credential {azure-cli,managed-identity}, --credential {azure-cli,managed-identity}
105                                      Optionally specify the type of credential to use when
106                                      authenticating with Azure. If omitted then Azure Blob
107                                      Storage credentials will be obtained from the
108                                      environment and the default Azure authentication flow
109                                      will be used for authenticating with all other Azure
110                                      services. If no credentials can be found in the
111                                      environment then the default Azure authentication flow
112                                      will also be used for Azure Blob Storage.
113

REFERENCES

115       For Boto:
116
117       • <https://boto3.amazonaws.com/v1/documentation/api/latest/guide/con
118         figuration.html>
119
120       For AWS:
121
122       • <https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-
123         set-up.html>
124
125       • <https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-
126         started.html>.
127
128       For Azure Blob Storage:
129
130       • <https://docs.microsoft.com/en-us/azure/storage/blobs/authorize-data-
131         operations-cli#set-environment-variables-for-authorization-parame‐
132         ters>
133
134       • <https://docs.microsoft.com/en-us/python/api/azure-storage-
135         blob/?view=azure-python>
136
137       For Google Cloud Storage:
138
139       • Credentials:   <https://cloud.google.com/docs/authentication/getting-
140         started#setting_the_environment_variable>
141
142         Only  authentication  with GOOGLE_APPLICATION_CREDENTIALS env is sup‐
143         ported at the moment.
144

DEPENDENCIES

146       If using --cloud-provider=aws-s3:
147
148       • boto3
149
150       If using --cloud-provider=azure-blob-storage:
151
152       • azure-storage-blob
153
154       • azure-identity (optional, if you wish to use DefaultAzureCredential)
155
156       If using --cloud-provider=google-cloud-storage
157
158       • google-cloud-storage
159

EXIT STATUS

161       0      Success
162
163       1      The delete operation was not successful
164
165       2      The connection to the cloud provider failed
166
167       3      There was an error in the command input
168
169       Other non-zero codes
170              Failure
171

BUGS

173       Barman has been extensively tested, and is currently being used in sev‐
174       eral  production environments.  However, we cannot exclude the presence
175       of bugs.
176
177       Any bug can be reported via the GitHub issue tracker.
178

RESOURCES

180       • Homepage: <https://www.pgbarman.org/>
181
182       • Documentation: <https://docs.pgbarman.org/>
183
184       • Professional support: <https://www.enterprisedb.com/>
185

COPYING

187       Barman is the property of EnterpriseDB UK Limited and its code is  dis‐
188       tributed under GNU General Public License v3.
189
190       © Copyright EnterpriseDB UK Limited 2011-2023
191

AUTHORS

193       EnterpriseDB <https://www.enterprisedb.com>.
194
195
196
197Barman User manuals             October 3, 2023  BARMAN-CLOUD-BACKUP-DELETE(1)
Impressum