Arq® Blog

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:

  1. Set your AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables to your access key ID and secret access key, respectively.
  2. Find the bucket name, region, hostname, and prefix that you want to delete.
  3. Run s3delete supplying a region plus a URL based on hostname, bucket name and prefix.
  4. Enter ‘Y’ to confirm.
  5. 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.

Need to back up your files securely to the cloud?

Set up backups in 1 minute with Arq 7:

Download Arq

30-day free trial

"Best backup solution? @arqbackup with your choice of cloud provider. Great program!! Always helpful when I have questions also. Great support!" @Tony_Simek Feb 5, 2021

"Just used @arqbackup for my first real world restore, which saved me hours of rework. Would recommend." @jonathon Nov 14, 2020