Python Forum
help me with python script for AWS S3 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: help me with python script for AWS S3 (/thread-573.html)



help me with python script for AWS S3 - DDPYTHON - Oct-20-2016

In detail: when a file is uploaded via FTP to an FTP server in the one region, the data providers will move the file, causing an i_notify event. cron should handle this event and kick off a script that will upload this file to the S_3 bucket in the other region... Upload this file to the bucket using the accelerated endpoint and using multi part uploads.


RE: help me with python script for AWS S3 - sparkz_alot - Oct-20-2016

You forgot one detail... what is your question? Post the code you've written so far as well as the full Traceback if your code fails.


python script for aws s3 operation. - DDPYTHON - Oct-23-2016

i want to write a script that will be called by incron to upload files to the S3 bucket in the "other region" when the data files are moved. In detail: when a file is uploaded via FTP to an FTP server in the Ireland region, the file will move , causing an inotify event. Incron should handle this event and kick off a script that will upload this file to the S3 bucket in the us-east-1 bucket. Upload this file to the bucket using the accelerated endpoint  and using multipart uploads...
i wrote this much code for this..but i dont have any idea about incron and script is also not completed ... plz guide me through this.
i am posting screenshot of my code in attachment..and here too 

import os, sys

import boto3

client = boto3.client('s3')

def accelarationBucket():

    response = client.put_bucket_accelerate_configuration(

     Bucket=' mybucketname',

     AccelerateConfiguration={'Status': 'Enabled'}

    )

def creatMultipartUpload():    

    response = client.create_multipart_upload(

     Bucket='twc-ecmwf-data-eu-west-1',

     key='first'

    )


    response = client.complete_multipart_upload(

     Bucket='twc-ecmwf-data-eu-west-1',

     Key='first',

     UploadId=''

    )

def rsyncBucket():

    boto-rsync s3://twc-ecmwf-data-eu-west-1  s3://twc-ecmwf-data-us-east-1 

accelarationBucket()

creatMultipartUpload()
rsyncBucket()
İmage



RE: python script for aws s3 operation. - micseydel - Oct-24-2016

Could you elaborate on your question? You're more likely to get a reply that why, since it's harder for would-be answerers to try to figure out the question by reading your code and seeing what it does/doesn't do relative to your description of what you ultimately want.


RE: help me with python script for AWS S3 - nilamo - Oct-24-2016

(Oct-20-2016, 10:48 AM)DDPYTHON Wrote: In detail: when a file is uploaded via FTP to an FTP server in the one region, the data providers will move the file, causing an i_notify event. cron should handle this event and kick off a script that will upload this file to the S_3 bucket in the other region... Upload this file to the bucket using the accelerated endpoint and using multi part uploads.

That sounds like it was copy-pasted from a homework assignment.


RE: help me with python script for AWS S3 - micseydel - Oct-24-2016

Merged threads, keep that in mind while trying to read the flow above!