s3undelete

s3undelete is a simple utility that removes delete markers from S3 (and S3-compatible) objects in buckets that have versioning enabled.

It's handy if you accidentally delete a lot of data.

usage: s3undelete list|undelete region endpoint[/path/to/directory]
                    

With the 'list' argument, s3undelete prints a list of objects with delete markers as the latest version.

With the 'undelete' argument, s3undelete removes the delete marker from each object that has a delete marker as the latest version.

Download

macOS: s3undelete.pkg
SHA256(s3undelete.pkg)= bad8b24a98a2580a0c9e469f3b39fbf895346a9667a76ad32ff1139362a2c1b6
Windows: s3undelete.exe
SHA256(s3undelete.exe)= 6637a322899ad0e8e6ec3b53ccca7661875aae2088286edafb5d12e3a884e56f

Configuration

To use s3undelete, set 2 environment variables, AWS_ACCESS_KEY and AWS_SECRET_KEY, to your S3 access key ID and secret access key respectively.

Examples

  • Listing deleted objects in an S3 bucket named 'myversionedbucket' in the 'us-east-1' region:
    s3undelete list us-east-1 https://s3.us-east-1.amazonaws.com/myversionedbucket
                                
  • Listing deleted objects in a subdirectory of the bucket:
    s3undelete list us-east-1 https://s3.us-east-1.amazonaws.com/myversionedbucket/myobjects/subdirectory
    Removing delete markers:
    s3undelete undelete us-east-1 https://s3.us-east-1.amazonaws.com/myversionedbucket/myobjects/subdirectory
  • Removing delete markers from versioned objects in a B2 bucket via the S3-compatible API:
    s3undelete undelete us-west-1 https://s3.us-west-001.backblazeb2.com/arq-versioned
                                

See Also

s3delete