Skip to content
Snippets Groups Projects
Commit f55078dc authored by Milan's avatar Milan
Browse files

AWS-CLI fix

parent 25ac5df9
No related branches found
No related tags found
No related merge requests found
......@@ -52,60 +52,60 @@ To show the help (available commands) you can use help - **aws s3** tool allows
???+ note ""
The bucket name has to be unique within tenant. It should contain lower letters, numbers, dashes, and dots. The bucket name should begin only with a letter or number and cannot contain dots followed by a dash or dots preceded by a dash or multiple dots. We also recommend not using “slash” in the bucket name. Using the slash will disallow the usage of the bucket via API.
**Bucket creation**
**Bucket creation**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz mb s3://test1
**Bucket listing**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz ls
**Bucket listing**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz ls<br/>
2019-09-18 13:30:17 test1
**Bucket deletion**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz rb s3://test1
### Operation with files
**File upload**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp C:/Users/User/Desktop/test_file.zip s3://test1
**File upload**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp C:/Users/User/Desktop/test_file.zip s3://test1<br/>
upload: Desktop\test_file.zip to s3://test1/test_file.zip
**File download**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp s3://test1/test_file.zip C:\Users\User\Downloads\
**File download**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp s3://test1/test_file.zip C:\Users\User\Downloads\<br/>
download: s3://test1/test_file.zip to Downloads\test_file.zip
**File deletion**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz rm s3://test1/test_file.zip
**File deletion**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz rm s3://test1/test_file.zip<br/>
delete: s3://test1/test_file.zip
### Directory/Folder operation
???+ note ""
The content of the source folder is always copied while using the following command. It does not depend on the slash character at the end of the source path. The behavior of **aws** is in this perspective different than the rsync behavior. If you wish to have the source directory in the destination you can add the name of the source directory to the destination path. **AWS tool will create the directory in the destination while copying the data**, see the exemplary commands below. The same is valid in the case of directory downloads or synchronization via **aws s3 sync**.
**Upload the directory**
**Upload the directory**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp C:\Users\User\Desktop\test_dir s3://test1/test_dir/ --recursive
**Download the directory**
**Download the directory**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp s3://test1/test_dir C:\Users\User\Downloads\test_dir\ --recursive
**Directory deletion**
**Directory deletion**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz rm s3://test1/test_dir --recursive
**Directory sync -> upload to cloud**
**Directory sync -> upload to cloud**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz sync C:\Users\User\Desktop\test_sync s3://test1/test_sync/
**Directory sync -> download from cloud**
**Directory sync -> download from cloud**<br/>
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz sync s3://test1/test_sync/ C:\Users\User\Downloads\test_sync
## Controls of AWS CLI - api-level (s3api)
**aws** tool allows the usage of **aws s3api** module. This module provides advanced functions to control S3 service, see below. The configuration of credentials and connections is the same like for **aws** in the beginning of this guide.
The set of available commands can be obtained by the following command with the option **help**. Alternatively is the complete list available in the **[AWS website](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)**.
The set of available commands can be obtained by the following command with the option **help**. Alternatively is the complete list available in the [AWS website](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html).
## Exemplary configuration file for aws tool
## Exemplary configuration file for AWS-CLI
After successful configuration, the configuration file should be created. You can find the example below. You can find the credentials file in the same path.
???+ note "Config file"
Windows: C:/Users/User/.aws/config<br/>
Linux: /home/user/.aws/config<br/>
[<br/>profile test-user]<br/>
Linux: /home/user/.aws/config<br/>
<br/>[profile test-user]<br/>
region =<br/>
output = text<br/>
......@@ -118,28 +118,3 @@ After successful configuration, the configuration file should be created. You ca
### Bucket versioning
Detail documentation for Object Storage services could be found at [du.cesnet.cz](https://du.cesnet.cz/en/navody/object_storage/start)
![](rclone-screenshots/rclone-gui-s3-2.png){ style="display: block; margin: 0 auto" }
!!! warning
To be able to configure the rclone tool using this guide **first, you have to download, unzip and install rclone**, the guide can be found in the [first section](#downloading-and-installation-of-rclone-tool).
???+ note "Command line in Windows and Linux"
**Windows users** need to run **Command Prompt** and then run the command below.
**Linux users** can open the **terminal window** and then run the command below.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment