> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/storage/object-storage/how-tos/clients-and-tooling/use-rclone-with-object-storage.md).

# Use Rclone with 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

{% tabs %}
{% tab title="Debian/Ubuntu" %}
{% code title="Multiple commands" %}

```
sudo apt update
sudo apt install rclone -y
```

{% endcode %}
{% endtab %}

{% tab title="Fedora/AlmaLinux" %}
{% code title="Command" %}

```
sudo dnf install rclone
```

{% endcode %}
{% endtab %}
{% endtabs %}

## 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:

{% code title="Command" %}

```
rclone config
```

{% endcode %}

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 <kbd>Enter</kbd>.

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
<strong>n/s/q>n
</strong></code></pre>

Enter the name you want to give your connection and press <kbd>Enter</kbd>. In this example, we use *GleSYSS3Remote*.

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code><strong>name>GleSYSS3Remote
</strong></code></pre>

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 <kbd>Enter</kbd>.

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
<strong>Storage>s3
</strong></code></pre>

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

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>Choose your S3 provider.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
<strong>provider>ceph
</strong></code></pre>

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 <kbd>Enter</kbd> to continue.

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
Only applies if access_key_id and secret_access_key is blank.
Enter a boolean value (true or false). Press Enter for the default ("false").
Choose a number from below, or type in your own value
<strong>env_auth>
</strong></code></pre>

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

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>AWS Access Key ID.
Leave blank for anonymous access or runtime credentials.
Enter a string value. Press Enter for the default ("").
<strong>access_key_id>QWERTY12345ASDFG56789
</strong></code></pre>

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 <kbd>Enter</kbd>.

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>AWS Secret Access Key (password)
Leave blank for anonymous access or runtime credentials.
Enter a string value. Press Enter for the default ("").
<strong>secret_access_key>Fdf3SfrFSV7v44Tv3V7b5fgh8rghfgRTBTy7gDt
</strong></code></pre>

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

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>Region to connect to.
Leave blank if you are using an S3 clone and you don't have a region.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
<strong>region>
</strong></code></pre>

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 <kbd>Enter</kbd>.

<pre><code>Endpoint for S3 API.
Required when using an S3 clone.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
<strong>endpoint>objects.dc-fbg1.glesys.net
</strong></code></pre>

Since we omitted the region, we can also skip the *Location constraint*. Press <kbd>Enter</kbd> to continue.

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>Location constraint - must be set to match the Region.
Leave blank if not sure. Used when creating buckets only.
Enter a string value. Press Enter for the default ("").
<strong>location_constraint>
</strong></code></pre>

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 <kbd>Enter</kbd>. This means that only the owner of the objects will have access.

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>Canned ACL used when creating buckets and storing or copying objects.
This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
Note that this ACL is applied when server side copying objects as S3
doesn't copy the ACL from the source but rather writes a fresh one.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
<strong>acl>private
</strong></code></pre>

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

<pre data-title="Interactive session. Prompts and inputs are highlighted."><code>Edit advanced config? (y/n)
y) Yes
n) No
<strong>y/n>n
</strong></code></pre>

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

<pre><code>Remote config
--------------------
[GleSYSS3Remote]
provider = Ceph
access_key_id = QWERTY12345ASDFG56789
secret_access_key = Fdf3SfrFSV7v44Tv3V7b5fgh8rghfgRTBTy7gDt
endpoint = objects.dc-fbg1.glesys.net
acl = private
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
<strong>y/e/d>y
</strong></code></pre>

Exit the configuration by typing `q` and pressing <kbd>Enter</kbd>.

## 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.

{% code title="Command" %}

```
rclone copy -v file.txt GleSYSS3Remote:bucketname
```

{% endcode %}

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

{% code title="Command" %}

```
rclone ls GleSYSS3Remote:bucketnamn
```

{% endcode %}

## 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](https://rclone.org/docs/).

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:

{% code title="Command" %}

```
rclone lsd remotename:
```

{% endcode %}

Create a bucket:

{% code title="Command" %}

```
rclone mkdir remotename:bucketname
```

{% endcode %}

List the content of a bucket:

{% code title="Command" %}

```
rclone ls remotename:bucketname
```

{% endcode %}

Synchronize a local directory to a remote:

{% code title="Command" %}

```
rclone sync /folder/ remotename:bucketname
```

{% endcode %}

## 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.

* Read more about [rclone copy](https://rclone.org/commands/rclone_copy/).
* Read more about [rclone sync](https://rclone.org/commands/rclone_sync/).

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`.&#x20;

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

{% code title="crontab" %}

```
15 4 * * * rclone sync ~/filer/ remotename:bucketname
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.glesys.com/products/storage/object-storage/how-tos/clients-and-tooling/use-rclone-with-object-storage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
