jordansissel / s3cleaner Goto Github PK
View Code? Open in Web Editor NEWAmazon S3 file cleaner - delete things older than a certain age, matching a pattern, etc.
License: Other
Amazon S3 file cleaner - delete things older than a certain age, matching a pattern, etc.
License: Other
Hi. I am not interested in a regexp search to match files against. I want to delete files + folders older than certain days. How is this done through this script? The help is sparse, thanks for any specific tips!
S3 returns the last_modified date in GMT, if the local system has a timezone different from GMT, the following lines will produce undesired behavior.
mtime = time.mktime(time.strptime(key.last_modified.split(".")[0], "%Y-%m-%dT%H:%M:%S"))
now = time.time();
mtime will be relative to GMT where now will be relative to the users localtime which makes the behavior of the --max-age parameter somewhat unexpected. To fix this, the local time should be calculated in the same timezone as mtime which can be done by replacing the second line with this.
now = time.mktime(time.gmtime())
I'm receiving syntax errors everywhere with this app. Even when I just try to view the usage:
# python s3cleaner.py --help
File "s3cleaner.py", line 55
print "Deleting: s3://%s/%s" % (bucket.name, key.name)
^
SyntaxError: invalid syntax
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.