Rclone for S3
Please note that the configuration example may vary from version to version. Version 2.0.1 was used in this example.
To configure rclone to work with the Selectel Cloud Storage, run the following:
The console will display the following dialog:
No remotes found - make a new one n) New remote [...] n/r/c/s/q>
Select n and press Enter.
Specify the name of the connection to the remote storage (any name is appropriate, for example, selectel-s3):
Select the storage type:
Type of storage to configure. Choose a number from below, or type in your own value [...] 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc) \ "s3" [...]
Choose the service provider:
Choose your S3 provider. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [...] 10 / Any other S3 compatible provider \ "Other"
Select the type of credentials (manually or from environment variables):
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. Enter a boolean value (true or false). Press Enter for the default ("false"). Choose a number from below, or type in your own value 1 / Enter AWS credentials in the next step \ "false" 2 / Get AWS credentials from the environment (env vars or IAM) \ "true"
Specify false to enter data manually:
The system will request the access key (login).
AWS Access Key ID. Leave blank for anonymous access or runtime credentials. Enter a string value. Press Enter for the default ("").
Enter your login in the AccountNumber_UserName format:
The system will request the secret key (password). You can view the password in the Conrol panel.
AWS Secret Access Key (password) Leave blank for anonymous access or runtime credentials. Enter a string value. Press Enter for the default ("").
Enter user password:
The system will request the region:
Region to connect to. Leave blank if you are using an S3 clone and you don't have a region. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value [...]
Enter the ru-1a region:
Endpoint for S3 API. Required when using an S3 clone. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value
Specify the region of bucket creation:
Location constraint - must be set to match the Region. Leave blank if not sure. Used when creating buckets only. Enter a string value. Press Enter for the default (""). location_constraint>
Leave the field blank and press Enter.
Set ACL access rights:
Canned ACL used when creating buckets and/or storing objects in S3. For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl Choose a number from below, or type in your own value 1 / Owner gets FULL_CONTROL. No one else has access rights (default). \ "private" [...]
After that, you can deny the advanced configuration:
Edit advanced config? (y/n) y) Yes n) No
Check the data:
-------------------- [selectel-s3] type = s3 provider = Other env_auth = false access_key_id = AccountNumber_UserName secret_access_key = Password region = ru-1a endpoint = https://s3.selcdn.ru acl = private -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote
Save the created profile. Enter y:
Command Syntax for Working with the Storage
You can learn more about all commands in the official rclone documentation.
For a quick reference, run the following:
Viewing a List of Buckets
rclone lsd selectel-s3:
Creating a New Bucket
rclone mkdir selectel-s3:BucketName
Viewing a List of Files
rclone ls selectel-s3:BucketName
Copying Files from the Local Machine to the Storage
rclone copy /home/local/directory selectel-s3:BucketName
Synchronizing Files on the Local Machine and in the Storage
rclone sync /home/local/directory selectel-s3:BucketName
Synchronizing Files in the Storage with Files on the Local Machine
rclone sync selectel-s3:BucketName /home/local/directory
When performing copy and sync operations, rclone checks all files by date and modification time, as well as by md5 sum. The files that have changed are transferred from the source container to the designated one.