After configuring OSS, how to upload existing files on the server to OSS? It is recommended to use ossutil.

1. Download and install ossutil

sudo -v ; curl https://gosspublic.alicdn.com/ossutil/install.sh | sudo bash


2. Interactive configuration to generate configuration files
ossutil config


Set the configuration file path, tool language, Endpoint, AccessKey ID, AccessKey Secret, and STSToken parameters according to the prompts. Leave STSToken blank.

The default configuration file path is: /root/.ossutilconfig. Press Enter to use the default path.
Set the language of the tool: CH
Endpoint: https://oss-cn-hongkong.aliyuncs.com (Select this according to your own OSS bucket region)< /span> After the above configuration, it will be generated A configuration file, if you need to change parameters, just change it in this file. AccessKey Secret: AccessKey of Alibaba Cloud account
AccessKey ID: AccessKey of Alibaba Cloud account


3 Use upload verification
 

文件上传:ossutil cp test.txt oss://oss桶名/目录名

目录所有文件上传:ossutil cp -r 服务器目录 oss://oss桶名/目录名

Guess you like

Origin blog.csdn.net/qq_24138677/article/details/134832106