Rclone
Rclone — is a command line interface for working with objects in S3.
Customize Rclone
1. Set up access to S3
Access can be configured by the Account Owner or a user with the role of iam_admin.
- Create a service user with the role with access to S3.If you use a service user with the role object_storage_user or
s3.bucket.useryou must have a bucket policy configured in the bucket. - Issue an S3 key to the user.
2. Install the client
Rclone version v1.69 or higher is required for compatibility with Selectel.
Windows
Linux/macOS
-
On the Rclone website, download the distribution for Windows.
-
Unpack the archive with the distribution.
-
Open a command prompt.
-
Navigate to the directory with the distribution:
cd <path>Specify
<path>— the path to the directory with the distribution.
-
Open the terminal.
-
Install Rclone any way you want — for example, with a ready-made script:
sudo -v ; curl https://rclone.org/install.sh | sudo bashLearn more about all the installation methods on the Rclone website.
3. Create an Rclone configuration
-
Make sure that Virtual-Hosted addressing is enabled in the baket.
-
Open the configuration mode:
rclone configA dialog box will appear in the console:
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config -
Create a new configuration:
n/s/q> n -
Enter the name of the remote storage connection (for example,
selectel_s3):name> selectel_s3 -
Enter the type of storage that is listed after the string
Amazon S3 Compliant Storage Providers including ..., Selectel, ...:Storage> s3 -
Enter the type of provider that is listed after the line
Any other S3 compatible provider:provider> Selectel -
Select the method for obtaining authorization
credentialsthat is listed after the lineEnter AWS credentials in the next step:env_auth> false -
Enter the
AWS Access Key ID:access_key_id> <access_key>Specify
<access_key>— the value of the Access key field from the S3 key. -
Enter the
AWS Secret Access Key (password):secret_access_key> <secret_key>Specify
<secret_key>— the value of the Secret key field from the S3 key.. -
Enter the pool in which S3 is located (e.g.,
ru-1):region> <pool> -
Enter the URL for S3 API access:
endpoint> <s3_domain>Specify
<s3_domain>— S3 API domain, depends on the pool S3 is in. -
Leave the
location_constraintparameter empty. -
Leave the
aclparameter blank. -
Leave the
Edit advanced configoption blank or entern. -
Check the configuration:
Remote config
--------------------
[selectel_s3]
type = s3
provider = Selectel
env_auth = false
access_key_id = <access_key>
secret_access_key = <secret_key>
region = <pool>
endpoint = <s3_domain>
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remoteIf the configuration is correct, press Enter.If not, enter
eand edit the configuration. -
Confirm the creation of the configuration:
y/e/d> y -
Exit the settings dialog box:
e/n/d/r/c/s/q> q
Working with Rclone
Command format
General view of the teams:
<command> <remote_name>:<bucket_name>/<object_name>
Specify:
<command>— Rclone command of the formrclone <subcommand>. You can view all commands on the Rclone website or in the output of the commandrclone --help<remote_name>— the connection name specified when configuring Rclone;<bucket_name>— bucket name;- optional:
<object_name>— object name.
Create a bucket
Only a private bucket can be created via the S3 API.
-
Open the CLI.
-
Create a bucket:
rclone mkdir <remote_name>:<bucket_name>Specify:
<remote_name>