直接用Aws python (S3 SDK)
import boto3 def backup_s3(filepath, s3_bucket, s3key, s3_access_key=None, s3_secret_key=None,endpoint_url=None): s3 = None if s3_access_key and s3_secret_key: s3 = boto3.client('s3', aws_access_key_id=s3_access_key, aws_secret_access_key=s3_secret_key, endpoint_url=endpoint_url) else: s3 = boto3.client('s3') s3.upload_file(filepath, s3_bucket, s3key) # s3.download_file("swifttest", "curr_key", "dest_file") if __name__ == '__main__': backup_s3(filepath = "C:/Users/Sea/Downloads/seatest.xlsx",s3_bucket= "sea", s3key = "seatest.xlsx", s3_access_key= "paZRwWpsuM3vkUuw",s3_secret_key="WzLqVt5g9mtM33cQJyQApLOUivXahYeL", endpoint_url="http://192.168.18.199:9001")
标签:__,None,minio,s3,access,secret,key,使用,客户端 From: https://www.cnblogs.com/lshan/p/17406491.html