Use Rclone with Object Storage

Rclone is an open-source software for backups that supports S3-compatible storage solutions, such as Glesys Object Storage.


Rclone is a tool used to synchronize files and directories to and from various cloud service providers. With Rclone, you can, among other things, upload and download files, encrypt data, create buckets, and see how much data is stored.

Install Rclone

Multiple commands
sudo apt update
sudo apt install rclone -y

Configure Rclone

Before you can configure Rclone, you need to create an Object Storage instance in Glesys Cloud.

Be careful to note down the values you enter and that are generated. Check the box to create an initial bucket when the instance is created. You must record the secret key (Secret Access Key) because you cannot retrieve it later.

Now it’s time to start the actual configuration. You start it with the following command:

Command
rclone config

Now you will be presented with a series of questions that need to be answered.

First, you should choose to create a new remote—that is, a new connection to the object storage service. Type n and press Enter.

Interactive session. Prompts and inputs are highlighted.
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q>n

Enter the name you want to give your connection and press Enter. In this example, we use GleSYSS3Remote.

You will now be presented with a list of the different services Rclone can connect to. To connect to a generic S3‑compatible storage service, type s3 and press Enter.

In the next step, you choose which provider you want to use. Glesys Object Storage uses Ceph. Type ceph and press Enter to continue.

Now it’s time to start entering the values you provided and received when you created your object storage instance.

First, choose how your keys will be retrieved. You will enter them manually, so press Enter to continue.

The first one is the Access Key. Type in the access key value you received when you created the instance and press Enter.

Next up is Secret Access Key. This is your Secret Key value you received when you created your instance. Type in the value and press Enter.

The next step concerns the region, which isn't used in Glesys Object Storage. Just press Enter here.

Now you need to enter the address of your endpoint. You received this information when you created your object storage instance. If your instance is located in Falkenberg, it's objects.dc-fbg1.glesys.net. If it's located in Stockholm, it's objects.dc-sto1.glesys.net. Type in the address and press Enter.

Since we omitted the region, we can also skip the Location constraint. Press Enter to continue.

Now you can set the default permission that will be applied to your objects. You can, of course, create more specific permissions later. Enter private and press Enter. This means that only the owner of the objects will have access.

Now you’re almost finished. When prompted whether you want to modify advanced configuration settings, type n and press Enter.

In the final step, you receive a summary of your configuration. If everything looks correct, type y and press Enter to save.

Exit the configuration by typing q and pressing Enter.

Verify that Rclone is working

You can easily upload a file using the command below. Replace bucketname with the name of the bucket that was created for you when you set up your object storage instance.

To verify whether your file has been uploaded, use the following command.

Useful commands

There is a whole slew of commands and functions that Rclone can perform. Below we have listed some of the most useful ones. For a complete list of commands, visit rclone.org.

In the examples below, remotename is the name of your remote connection, for example, GleSYSS3Remote as we have previously used. bucketname is the name of a bucket in your object storage instance.

List all buckets on your remote:

Create a bucket:

List the content of a bucket:

Synchronize a local directory to a remote:

Using Rclone for backups

You can use rclone copy or rclone sync to back up files to Glesys Object Storage. The difference is that copy doesn't delete any files from the destination. So even if files are deleted from the source, those files aren't automatically deleted from the destination with copy. But when using sync, rclone synchronizes the directories/files to be identical. So if a file is deleted from the source, that file will also be deleted from the destination.

Then, when you have decided whether copy or sync is the best approach for your backups, you can schedule nightly backups using cron. Edit your crontab using crontab -e.

For example, the following crontab will run a rclone sync at 04:15 every morning.

Last updated

Was this helpful?