Skip to content

Instantly share code, notes, and snippets.

@stefhen
Created April 10, 2014 21:39
Show Gist options
  • Save stefhen/10425970 to your computer and use it in GitHub Desktop.
Save stefhen/10425970 to your computer and use it in GitHub Desktop.
Mass delete s3 keys
#!/usr/bin/env python
import boto
s3 = boto.connect_s3()
bucket = s3.get_bucket("bucket")
rs = bucket.list(prefix="key/prefix/here")
result = bucket.delete_keys([key.name for key in rs])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment