Skip to content

Instantly share code, notes, and snippets.

@miend
Created October 17, 2012 17:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miend/3906763 to your computer and use it in GitHub Desktop.
Save miend/3906763 to your computer and use it in GitHub Desktop.
Script to delete files from Amazon s3 that match given date
#!/bin/bash
objects=$(s3cmd ls s3://bucket/directory/* |grep 2012-10-17 | cut -f13 -d' ')
for line in $objects ; do
s3cmd del $line
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment