s3delete and s3undelete
We’ve made 2 utilities that are handy for testing Arq 7’s new immutable-backups feature. We share them here in case they’re handy for you too.
s3delete
s3delete is a command-line utility that will attempt to delete every version of every object within whatever prefix you specify. Download the binary here.
To use it:
- Set your
AWS_ACCESS_KEY
andAWS_SECRET_KEY
environment variables to your access key ID and secret access key, respectively. - Find the bucket name, region, hostname, and prefix that you want to delete.
- Run s3delete supplying a region plus a URL based on hostname, bucket name and prefix.
- Enter ‘Y’ to confirm.
- Enter ‘permanently delete’ to confirm a second time (it’s deleting stuff after all).
Type s3delete
with no arguments to get a usage statement:
usage: s3delete region endpoint[/path/to/directory]
For example to delete all versions of all objects starting with C9916BA5-C178-46FB-9852-109E429A913A in my bucket ‘arq-object-lock’:
$ s3delete us-east-2 https://s3-us-east-2.amazonaws.com/arq-object-lock/C9916BA5-C178-46FB-9852-109E429A913A
s3undelete
s3undelete is a command-line utility that will attempt to delete every delete marker it can find within whatever prefix you specify. Download the binary here.
s3undelete is handy for uncovering objects in a versioned bucket that are covered up by delete markers.
Run s3undelete
with no arguments to get a usage statement:
usage: s3undelete list|undelete region endpoint[/path/to/directory]
To list the delete markers, specify list
as the first parameter:
s3undelete list us-east-2 https://s3-us-east-2.amazonaws.com/arq-object-lock/C9916BA5-C178-46FB-9852-109E429A913A
s3undelete will print the path of every delete marker.
To “undelete” files (delete the delete markers), specify undelete as the first parameter:
s3undelete undelete us-east-2 https://s3-us-east-2.amazonaws.com/arq-object-lock/C9916BA5-C178-46FB-9852-109E429A913A
s3undelete will attempt to delete every delete marker.