SHARE
TWEET

Untitled

a guest Jun 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. s3 = boto3.client('s3')
  2. s3_bucket = 'bucket-name'
  3.  
  4. prefix = 'fo1/fo2/fo3'
  5. for obj in s3.list_objects_v2(Bucket=s3_bucket, Prefix=prefix, Delimiter='/'):
  6.      # Here when I print obj, it's a string with value as 'MaxKeys'
  7.      
  8. aws s3 cp foo.txt s3://my-bucket/fo1/fo2/fo3/foo.txt
  9.      
  10. aws s3 rm s3://my-buket/fo1/fo2/fo3/foo.txt
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top