Skip to content

Instantly share code, notes, and snippets.

@laser
Created January 24, 2014 22:12
Show Gist options
  • Save laser/8607811 to your computer and use it in GitHub Desktop.
Save laser/8607811 to your computer and use it in GitHub Desktop.
s3 pruner a
class S3FilePruner < JobProcessor
def process_job
Images.all.select do |image|
image.created_at < Date.today - 30
end.each do |image|
S3Object.delete image.s3_object_name, image.s3_bucket_name
image.destroy
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment