Skip to content

Instantly share code, notes, and snippets.

@cooncesean
Created August 26, 2013 21:51
Show Gist options
  • Save cooncesean/6347105 to your computer and use it in GitHub Desktop.
Save cooncesean/6347105 to your computer and use it in GitHub Desktop.
remove pending .mov keys
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from django.conf import settings
PROCESSED_PATH = 'uploads/videos/processed/'
# Remove .mov keys in PROCESSED DIR
for key in bucket.get_all_keys(prefix=PROCESSED_PATH):
if key.name != PROCESSED_PATH and key.name.split('.')[-1] == 'mov':
print key
key.delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment