Skip to content

Instantly share code, notes, and snippets.

@jarohen
Created September 27, 2013 10:22
Show Gist options
  • Select an option

  • Save jarohen/6726595 to your computer and use it in GitHub Desktop.

Select an option

Save jarohen/6726595 to your computer and use it in GitHub Desktop.
Deleting all objects in an S3 bucket, from Clojure (probably in a very inefficient way - sorry.)
(loop []
(when-let [objs (seq (map :key (:objects (aws.sdk.s3/list-objects (aws-creds) bucket))))]
(println "Deleting 1000 objs")
(dorun (pmap #(aws.sdk.s3/delete-object (aws-creds) bucket %) objs))
(recur)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment