Guest User

Untitled

a guest
Oct 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import boto
  4. from os.path import exists
  5. from sys import exit
  6.  
  7. s3_conn = boto.connect_s3()
  8.  
  9. key = s3_conn.get_all_buckets()[0].get_all_keys()[0]
  10.  
  11. if(exists(key.name)):
  12. print("The file named %s already exists." % (key.name))
  13. exit(0)
  14.  
  15. key.get_contents_to_filename(key.name)
Add Comment
Please, Sign In to add comment