Objective
Rclone is a backup tool that can sync to and from various storage backends, and can be used on Windows, macOS and Linux.
This guide explains how to set up Rclone to synchronize your files to and from S3 Object Storage.
Requirements
- A container
- A user with the required access rights on the container
- Your S3 credentials (access_key and secret_access_key)
- Rclone installed
See our Getting Started with S3 Object Storage guide.
Instructions
To configure Rclone, edit or download the rclone file from the OVHcloud Control Panel. To do so, log into the Control Panel and click Public Cloud at the top of the page. Then click Object Storage on the left-hand sidebar and navigate to the S3 users tab. Click the ... next to the user for which you wish to download the file and then click Download rclone file.
Next, import this configuration file into Rclone. To do so create the following file.
$ sudo vim ~/.config/rclone/rclone.conf
Copy and paste the contents of the rclone file you downloaded into this new file.
Command examples
Note: The default remote name is the first name in brackets in the configuration file.
List all containers:
$ rclone lsd <remote_name>:
Create a new container:
$ rclone mkdir <remote_name>:mycontainer
List the contents of a container:
$ rclone ls <remote_name>:mycontainer
Synchronize /home/user/documents
to a container:
$ rclone sync /home/user/documents <remote_name>:mycontainer
Copy a file /home/user/file.txt
into a container:
$ rclone copy /home/user/file.txt <remote_name>:mycontainer
Download a file file.txt
from a container:
$ rclone copy <remote_name>:mycontainer/file.txt fichier.txt
You will find on the official Rclone website a detailed documentation of the possible actions: Official Rclone documentation.