Skip to main content
Rclone
Last update:

Rclone

Rclone is a command-line interface for working with objects in object storage.

Through Rclone, you can work with the S3 API.

Customize Rclone

  1. Configure access.
  2. Install client.
  3. Create Rclone configuration.

1. Configure access

Access can be configured by a user with role Account Owner or User Administrator.

  1. Create a service user with a role with access to object storage, see Role Model Access for details.
  2. Issue the user an S3 key.

2. Install the client

  1. At the Rclone website, download the distribution for Windows.

  2. Unpack the archive with the distribution.

  3. Open a command prompt.

  4. Navigate to the directory with the distribution:

    cd <path>

    Specify <path> — the path to the directory with the distribution.

3. Create Rclone configuration

  1. Open the configuration mode:

    rclone config

    A dialog box will appear in the console:

    No remotes found, make a new one?
    n) New remote
    s) Set configuration password
    q) Quit config
  2. Create a new configuration:

    n/s/q> n
  3. Press Enter.

  4. Enter the name of the remote storage connection (for example, selectel_s3):

    name> selectel_s3
  5. Press Enter.

  6. Enter the storage type that is specified after the string Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc):

    Storage> s3
  7. Press Enter.

  8. Enter the type of provider that is specified after the Any other S3 compatible provider line:

    provider> other
  9. Press Enter.

  10. Select the method for obtaining credentials that is specified after the line Enter AWS credentials in the next step:

    env_auth> false
  11. Enter AWS Access Key ID:

    access_key_id> <access_key>

    Specify <access_key> is the value of the Access key field from S3-key.

  12. Enter AWS Secret Access Key (password):

    secret_access_key> <secret_key>

    Specify <secret_key> is the value of the Secret key field from S3-key.

  13. Enter pool, which hosts the object store:

    region> ru-1
  14. Enter the URL for S3 API access:

    endpoint> s3.ru-1.storage.selcloud.ru
  15. Leave the location_constraint parameter empty.

  16. Press Enter.

  17. Leave the acl parameter blank.

  18. Press Enter.

  19. Leave the Edit advanced config parameter blank or enter n.

  20. Press Enter.

  21. Check the configuration:

    Remote config
    --------------------
    [selectel_s3]
    type = s3
    provider = Other
    env_auth = false
    access_key_id = <access_key>
    secret_access_key = <secret_key>
    region = ru-1
    endpoint = s3.ru-1.storage.selcloud.ru
    --------------------
    y) Yes this is OK
    e) Edit this remote
    d) Delete this remote
  22. Confirm the creation of the configuration:

    y/e/d> y
  23. Press Enter.

  24. Exit the settings dialog box:

    e/n/d/r/c/s/s/q> q
  25. Press Enter.

Working with Rclone

Command format

General view of the teams:

<command> <remote_name>:<container_name>/<object_name>

Specify:

  • <command> — Rclone command of the form rclone <subcommand>. You can view all commands at the Rclone website or in the output of the rclone --help command
  • <remote_name> is the connection name specified when configuring Rclone;
  • <container_name> is the name of the container;
  • <object_name> — optional: object name.

Create a container

Only a private container can be created via the S3 API.

Create a container:

rclone mkdir <remote_name>:<container_name>

Specify:

  • <remote_name> is the connection name specified when configuring Rclone;
  • <container_name> is the name of the new container. Consider container naming rules, see the Bucket naming rules instructions in the AWS documentation for details.

View a list of facilities

Check out the list of facilities:

rclone ls <remote_name>:<container_name>/<prefix>

Specify:

  • <remote_name> is the connection name specified when configuring Rclone;
  • <container_name> is the name of the container;
  • <prefix> — optional: prefix, objects with which to output.

Download the object

When performing copy and synchronization operations, Rclone checks all objects by date and time of change or md5 sum. Objects that have been modified are transferred from the source directory to the destination directory.

Load the object from the local directory:

rclone copy <path> <remote_name>:<container_name>/<object_name>

Specify:

  • <path> — path to the object in the local directory;
  • <remote_name> is the connection name specified when configuring Rclone;
  • <container_name> is the name of the container;
  • <object_name> — optional: the name with which the object will be loaded. If it is not specified, the file name will be used.

Delete object

Delete the object:

rclone deletefile <remote_name>:<container_name>/<object_name>

Specify:

  • <remote_name> is the connection name specified when configuring Rclone;
  • <container_name> is the name of the container;
  • <object_name> is the name of the object to be deleted.