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.
- 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.
To configure Rclone, edit or download the Rclone file.
- Log into the OVHcloud Control Panel and click
Object Storageon the left-hand sidebar.
- Navigate to the
- Click the
...next to the user for which you wish to download the file.
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
- On Linux or Mac
Alternatively, specifying the
--config=CONFIG_FILE in the rclone command will override the default file.
CONFIG_FILE is the location of downloaded config file.
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
/home/user/documents to a container:
$ rclone sync /home/user/documents <remote_name>:mycontainer
In the above command,
/home/user/documentsis referred as source and
<remote_name>:mycontaineris 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