diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-11-20 01:15:38 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-11-20 01:15:38 -0500 |
commit | e89e9932e890061fa3c8712f629b919e75f58263 (patch) | |
tree | 069b8a72ff3a4ddf540b3417b98e5e67e8b117f6 | |
parent | 45d8f685e59901edac5dcffc1083bdf6fb6c7e3b (diff) | |
download | mongo-e89e9932e890061fa3c8712f629b919e75f58263.tar.gz |
helper script
-rw-r--r-- | buildscripts/s3del.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/buildscripts/s3del.py b/buildscripts/s3del.py new file mode 100644 index 00000000000..7967de62b02 --- /dev/null +++ b/buildscripts/s3del.py @@ -0,0 +1,36 @@ + +import os +import sys +import time + +sys.path.append( "." ) +sys.path.append( ".." ) +sys.path.append( "../../" ) +sys.path.append( "../../../" ) + +import simples3 +import settings +import subprocess + +# check s3 for md5 hashes + +def check_dir( bucket , prefix , todel ): + + for ( key , modify , etag , size ) in bucket.listdir( prefix=prefix ): + if key.find( todel ) < 0: + continue + print( key ) + time.sleep( 2 ) + bucket.delete( key ) + +def clean( todel ): + + + bucket = simples3.S3Bucket( settings.bucket , settings.id , settings.key ) + + for x in [ "osx" , "linux" , "win32" , "sunos5" , "src" ]: + check_dir( bucket , x , todel ) + + +if __name__ == "__main__": + clean( sys.argv[1] ) |