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.
There are two flavors of S3 Object Storage, which you can compare in the table below. You can also click here to view more detailed information about all Object Storage options.
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.
- Log into the OVHcloud Control Panel and click
Public Cloud
. - Click
Object Storage
on the left-hand sidebar. - Navigate to the
S3 users
tab. - Click the
...
next to the user for which you wish to download the file. - Click
Download rclone file
.
In the pop-up menu, select S3
as the File type and then click Download
. This option applies to "Standard Object Storage - S3 API" and "High Performance Object Storage - S3 API."
Next, copy the downloaded configuration file into following Rclone configuration directory to make it default:
- On Windows
%APPDATA%/rclone/rclone.conf
- On Linux or Mac
~/.config/rclone/rclone.conf
Alternatively, specifying the --config=CONFIG_FILE
in the rclone command will override the default file. CONFIG_FILE
is the location of downloaded config 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
-
In the above command,
/home/user/documents
is referred as source and<remote_name>:mycontainer
is referred as destination. Synchronizing the source to the destination will change the destination only. This command will match the destination with source, including deleting files if necessary from destination. It will not transfer files that are identical on source and destination (size and modification time or MD5SUM used for comparison).
Copy a file /home/user/file.txt
into a container:
$ rclone copy /home/user/file.txt <remote_name>:mycontainer
- The copy command is similar to sync with the only difference that it will not delete files from the destination. You can use this command to copy files or folders.
Download (restore) a file file.txt
from a container:
$ rclone copy <remote_name>:mycontainer/file.txt fichier.txt
Delete a file file.txt
from a container:
$ rclone delete <remote_name>:mycontainer/file.txt
You can add -P flag to show the progress and -v flag to show verbose count to the commands above.
Rclone command example with -Pv flags and overriding default configuration file:
$ rclone copy -Pv /home/user/file.txt <remote_name>:mycontainer --config=CONFIG_FILE
Go further
You will find on the official Rclone website a detailed documentation of the possible actions: Official Rclone documentation. Here are full lists of Rclone flags and Rclone commands.