How to Copy files to Alibaba Cloud Object Storage Service4 min read

We need your support!!
Other Amount:
24-Hour Flash Sale. Courses from just ₹ 490.
Devops Engineer
Sorry! The Author has not filled his profile.
follow me

Hi All

In our last article, we have seen how to Create Object Storage Service (OSS) bucket and Create a RAM user in Alibaba Cloud.Now we will see how to copy files from one instance to Cloud Object Storage Service (OSS).

OSS should be already activated and RAM user should be created and Access Key and Secret Key should be required. If you not yet created, Kindly go through our previous article how to Create Object Storage Service (OSS) bucket and Create a RAM user in Alibaba Cloud.


Ossutil allows us to manage OSS data easily through command lines and easy to manage or use through commands for bucket and object management.

Download ossutil installation file.



Change the permission of the file

chmod 755 ossutil64

[root@techrunnr1 ~]# wget
--2019-07-06 08:06:24--
Resolving (,
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9641827 (9.2M) [application/octet-stream]
Saving to: ‘ossutil64’

100%[=====================================================================================================================================================================>] 96,41,827   58.1MB/s   in 0.2s   

2019-07-06 08:06:24 (58.1 MB/s) - ‘ossutil64’ saved [9641827/9641827]

[root@techrunnr1 ~]# chmod 755 ossutil64

Configure ossutil64

[root@techrunnr1 ~]# ./ossutil64 config
The command creates a configuration file and stores credentials.

Please enter the config file path(default /root/.ossutilconfig, carriage return will use the default path. If you specified this option to other path, you should specify --config-file option to the path when you use other commands):
No config file entered, will use the default config file /root/.ossutilconfig

For the following settings, carriage return means skip the configuration. Please try "help config" to see the meaning of the settings
Please enter language(CH/EN, default is:EN, the configuration will go into effect after the command successfully executed):EN
Please enter accessKeySecret:**********************
Please enter stsToken:
Please enter endpoint:
Please enter accessKeyID:**********
[root@techrunnr1 ~]# 

endpoint: Endpoint of the region where the bucket belongs to. For more information, see Regions and endpoints.

accessKeyID: You can refer to our previous article.

accessKeySecret: You can refer to our previous article.

stsToken: This option is required only if we are using temporary STS token to access the OSS bucket.Otherwise, we can leave it blank.

Now configuring ossutil has been done.Let’s list the OSS bucket through ossutil command.

./ossutil64 ls

[root@techrunnr1 ~]# ./ossutil64 ls
CreationTime                                 Region    StorageClass    BucketName
2019-05-06 06:14:36 +0000 UTC         oss-me-east-1        Standard    oss://sample-bucket1
Bucket Number is: 1

0.071467(s) elapsed
[root@techrunnr1 ~]# 



In web console,lets see


Now let’s see how to copy one file to OSS bucket through command line using ossutil.

/root/ossutil64 cp file1.txt oss://sample-bucket1/testuploadfile/




How to copy a folder to OSS bucket through command Line using ossutil

/root/ossutil64 cp -r samplefolder oss://sample-bucket1



For help we can use.
/root/ossutil64 help

To download files or folders from OSS to the local system or any server please check this Download files/folders from OSS

There are lot of options in ossutil,we will see the other commonly used option later.



We need your support!!
Other Amount:
Questions Answered
Articles Written
Overall Points

Praseeb K Das

Techinal engineer,who works with passion what he does and ready to leran more and share the knoweldge. Keep learning.....

You may also like...

Leave a Reply