1% BARMAN-CLOUD-BACKUP-DELETE(1) Barman User manuals | Version 2.17 2% EnterpriseDB <http://www.enterprisedb.com> 3% December 1, 2021 4 5# NAME 6 7barman-cloud-backup-delete - Delete backups stored in the Cloud 8 9 10# SYNOPSIS 11 12barman-cloud-backup-delete [*OPTIONS*] *SOURCE_URL* *SERVER_NAME* 13 14 15# DESCRIPTION 16 17This script can be used to delete backups previously made with the 18`barman-cloud-backup` command. Currently AWS S3 and Azure Blob Storage 19are supported. 20 21The target backups can be specified either using the backup ID (as 22returned by barman-cloud-backup-list) or by retention policy. Retention 23policies are the same as those for Barman server and work as described in 24the Barman manual: all backups not required to meet the specified policy 25will be deleted. 26 27When a backup is succesfully deleted any unused WALs associated with that 28backup are removed. WALs are only considered unused if: 29 30 1. There are no older backups than the deleted backup *or* all older backups 31 are archival backups. 32 2. The WALs pre-date the begin_wal value of the oldest remaining backup. 33 3. The WALs are not required by any archival backups present in cloud storage. 34 35Note: The deletion of each backup involves three separate delete requests 36to the cloud provider (once for the backup files, once for the backup.info 37file and once for any associated WALs). If you have a significant number of 38backups accumulated in cloud storage then deleting by retention policy could 39result in a large number of delete requests. 40 41This script and Barman are administration tools for disaster recovery 42of PostgreSQL servers written in Python and maintained by EnterpriseDB. 43 44 45# POSITIONAL ARGUMENTS 46 47SOURCE_URL 48: URL of the cloud source, such as a bucket in AWS S3. 49 For example: `s3://BUCKET_NAME/path/to/folder` (where `BUCKET_NAME` 50 is the bucket you have created in AWS). 51 52SERVER_NAME 53: the name of the server as configured in Barman. 54 55# OPTIONS 56 57-h, --help 58: show a help message and exit 59 60-V, --version 61: show program's version number and exit 62 63-v, --verbose 64: increase output verbosity (e.g., -vv is more than -v) 65 66-q, --quiet 67: decrease output verbosity (e.g., -qq is less than -q) 68 69-t, --test 70: test connectivity to the cloud destination and exit 71 72-b *BACKUP_ID*, --backup-id *BACKUP_ID* 73: a valid Backup ID for a backup in cloud storage which is to be deleted 74 75-r *RETENTION_POLICY*, --retention-policy *RETENTION_POLICY* 76: used instead of --backup-id, a retention policy for selecting the backups 77 to be deleted, e.g. "REDUNDANCY 3" or "RECOVERY WINDOW OF 2 WEEKS" 78 79--dry-run 80: run without actually deleting any objects while printing information 81 about the objects which would be deleted to stdout 82 83--cloud-provider {aws-s3,azure-blob-storage} 84: the cloud provider to which the backup should be uploaded 85 86-P, --profile 87: profile name (e.g. INI section in AWS credentials file) 88 89--endpoint-url 90: override the default S3 URL construction mechanism by specifying an endpoint. 91 92# REFERENCES 93 94For Boto: 95 96* https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html 97 98For AWS: 99 100* http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html 101* http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html. 102 103For Azure Blob Storage: 104 105* https://docs.microsoft.com/en-us/azure/storage/blobs/authorize-data-operations-cli#set-environment-variables-for-authorization-parameters 106* https://docs.microsoft.com/en-us/python/api/azure-storage-blob/?view=azure-python 107 108# DEPENDENCIES 109 110If using `--cloud-provider=aws-s3`: 111 112* boto3 113 114If using `--cloud-provider=azure-blob-storage`: 115 116* azure-storage-blob 117* azure-identity (optional, if you wish to use DefaultAzureCredential) 118 119# EXIT STATUS 120 1210 122: Success 123 124Not zero 125: Failure 126 127 128# BUGS 129 130Barman has been extensively tested, and is currently being used in several 131production environments. However, we cannot exclude the presence of bugs. 132 133Any bug can be reported via the Github issue tracker. 134 135# RESOURCES 136 137* Homepage: <http://www.pgbarman.org/> 138* Documentation: <http://docs.pgbarman.org/> 139* Professional support: <http://www.enterprisedb.com/> 140 141 142# COPYING 143 144Barman is the property of EnterpriseDB UK Limited 145and its code is distributed under GNU General Public License v3. 146 147© Copyright EnterpriseDB UK Limited 2011-2021 148