upload_1.py 396 B

1234567
  1. def upload_to_s3(file_list, bucket_name):
  2. conn = boto3.resource('s3', aws_access_key_id=aws_access_key, aws_secret_access_key=aws_secret_key,
  3. config=Config(signature_version='s3v4'))
  4. for file in file_list:
  5. print('Uploading: ' + file + '\n')
  6. remote_name = file.split('/')
  7. conn.Object(bucket_name, file).put(Body=open(log_dir + file, 'rb'))