How to Set Up Automatic Backups with Rclone and Vultr Object Storage

Updated on June 12, 2024
How to Set Up Automatic Backups with Rclone and Vultr Object Storage header image


Rclone is an open-source command-line utility for managing files across different cloud storage services. The utility supports over 70 cloud storage products including Vultr Object Storage and is written in the modern Go programming language.

You can use Rclone to sync files between a Vultr Cloud Compute instance and a remote cloud storage service. This approach is ideal for backup solutions because Rclone's feature-rich customizable options allow you to automate the process.

This guide walks you through setting up automatic backups with Rclone and Vultr Object Storage on Ubuntu 24.04.


Before you begin:

Install and Configure Rclone

The Rclone developer community maintains an automatic shell script to streamline installing Rclone across different operating systems. After installing Rclone, the config command allows you to set up a remote repository for your backup.

Install Rclone

Install Rclone using the script:

  1. Download the script using the Linux curl command and execute the script using the bash command.

    $ sudo -v ; curl | sudo bash
  2. Check the version to ensure you've successfully installed Rclone.

    $ rclone version


    - os/version: ubuntu 24.04 (64 bit)
    - os/kernel: 6.8.0-31-generic (x86_64)
    - os/type: linux
    - os/arch: amd64
    - go/version: go1.22.1
    - go/linking: static
    - go/tags: none

Configure Rclone

Rclone keeps the configuration file under your home directory. Locate the file and customize the configurations:

  1. Run the following command to view the default Rclone configuration file location.

    $ rclone config file


    Configuration file doesn't exist, but rclone will use this path:
  2. Copy the above path and open the file with a text editor like Nano.

    $ sudo nano /home/$USER/.config/rclone/rclone.conf
  3. Enter the following configuration information into the file. Replace your_access_key_id, your_secret_key_id, and your_endpoint with the correct Vultr Object Storage S3 credentials. Empty values instruct Rclone to run with the default settings.

    type = s3
    provider = Other
    env_auth = false
    access_key_id = your_access_key_id
    secret_access_key = your_secret_key_id
    region =
    endpoint = your_endpoint
    location_constraint =
    acl = private
    server_side_encryption =
    storage_class =

    Save and close the file.

    The above configuration file contains the following settings:

    • [s3-storage]: Defines the beginning of a configuration file section and sets a name for the remote storage path.

    • type: Defines a provider type. For instance, s3.

    • provider: Specifies the S3 provider. Other defines any S3 compatible provider not defined on the Rclone website.

    • env_auth: Retrieves S3 access credentials from Linux environment variables. This only applies if you've not set the access_key_id and secret_access_key.

    • access_key_id: Defines the S3 Access Key.

    • secret_access_key: Defines the S3 Secret Key.

    • region: Specifies a region to connect to. Leave blank for S3 clone.

    • endpoint: Defines an S3 hostname or API endpoint. For instance,

    • location_constraint: Specifies a region when creating a bucket. Leave blank for S3 clones.

    • acl: Sets grants and permissions. A PRIVATE value means the Object storage owner gets full control and no one else has access rights.

      By default, Vultr sets Object Storage instances acl setting to PRIVATE.
    • server_side_encryption: Specifies the data encryption standard or algorithm for file storage.

    • storage_class: Sets a storage class depending on performance, durability, and cost.

  4. Ensure the Rclone configuration file is active.

    $ rclone config file


    Configuration file is stored at:
  5. Try retrieving the S3 storage bucket name to check if Rclone successfully connects to the Vultr Object Storage.

    $ rclone lsd s3-storage:


    -1 2024-05-27 10:43:58        -1 your-s3-bucket

Run Rclone Manual Backups

Rclone provides two powerful commands for running backups:

  • rclone copy: This command copies files from a source location to the defined location. The command skips the already copied files allowing you to run incremental backups.

    $ rclone copy source destination
  • rclone sync: This command synchronizes the source and destination locations. The command modifies the destination location only.

    $ rclone sync source destination
    If you delete a file in the source location and run the sync command, Rclone also deletes the file in the remote destination. Therefore, to avoid accidentally deleting your backups, use the copy command. For best results, always follow the 321 backup rule to ensure data redundancy, diversity, and geographic separation:
    1. Always keep three 3 of your critical data.
    2. Store the data copies on 2 different media.
    3. Keep 1 copy of your data offsite.

To run a manual backup and copy files to the S3 Object Storage using the copycommand, follow the steps below:

  1. Create a new project directory under your home directory. In a production environment, you may skip this step and select an existing directory that you want to back up.

    $ mkdir ~/project
  2. Switch to the new ~/project directory.

    $ cd ~/project
  3. Create two sample text files under the directory.

    $ touch test1.txt
    $ touch test2.txt
  4. Use the Rclone copy command to upload the two files to the Object Storage. Replace your-s3-bucket with the correct Vultr Object Storage bucket name.

    $ rclone copy ~/project s3-storage:your-s3-bucket/project
  5. List all files in the S3 storage.

    $ rclone ls s3-storage:


    0 your-s3-bucket/project/test1.txt
    0 your-s3-bucket/project/test2.txt
  6. Check the size of the files.

    $ rclone size s3-storage:


    Total objects: 2
    Total size: 0 B (0 Byte)
  7. Modify the test1.txt file.

    $ nano test1.txt
  8. Enter the following dummy content.

    Lorem Ipsum is simply dummy text of the printing and typesetting industry.

    Save and close the file.

  9. Sync the new changes using the Rclone copy command.

    $ rclone copy ~/project s3-storage:my-s3-bucket/project
  10. Check the remote S3 storage size.

    $ rclone size s3-storage:


    Total objects: 2
    Total size: 75 B (75 Byte) 

    From the above output, it's clear that the backup works.

Run Rclone Automatic Backups with Cron Jobs

Backups work well when run automatically because you might forget to run manual backups regularly. In this section, set up automatic Rclone backups using Linux Cron jobs.

  1. Open the crontab configuration file.

    $ sudo nano /etc/crontab

    The following settings detail the basic configurations you should make to schedule a Cron Job that runs at a specific time.

    .---------------- minute (0 - 59)
    |  .------------- hour (0 - 23)
    |  |  .---------- day of month (1 - 31)
    |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
    |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
    |  |  |  |  |
    *  *  *  *  * user-name command to be executed

    Linux Cron job provides flexible timings that you can use. Here are some ideal settings for backups.

    • * * * * * your_user_name rclone command: Runs every minute.
    • 0 0 * * * your_user_name rclone command: Runs every day at midnight.
    • 0 0 * * 0 your_user_name rclone command: Runs every Sunday at midnight.
    • 0 0 1 * * your_user_name rclone command: Runs every first day of the month at midnight.

    Refer to the guide on How to Use the Cron Task Scheduler to learn more about customizing the Cron job timings.

  2. Set a Cron Job that runs every minute by adding the following configuration information to the end of the /etc/crontab file. Replace your_user_name with your correct Linux username and your-s3-bucket with the correct Vultr Object Storage bucket name.

    * * * * * your_user_name /usr/bin/rclone copy ~/project s3-storage:your-s3-bucket/project

    Save and close the file.

  3. Add a new file to the local ~/project directory.

    $ touch ~/project/test3.txt
  4. Watch the crontab log file continuously using the Linux tail and grep commands.

    $ sudo tail -f /var/log/syslog | grep CRON


    May 28 07:17:01...CMD (/usr/bin/rclone copy ~/project s3-storage:your-s3-bucket/project)    
    May 28 07:18:01 ... CMD (/usr/bin/rclone copy ~/project s3-storage:your-s3-bucket/project)
  5. Press Ctrl + C to exit the previous command. Then, list the S3 storage files after the cron Job runs at least once.

    $ rclone ls s3-storage:


    75 your-s3-bucket/project/test1.txt
    0 your-s3-bucket/project/test2.txt
    0 your-s3-bucket/project/test3.txt

    The Cron Job is now running as expected and Rclone successfully uploaded the new test3.txt to the S3 storage.

Restore Backups

You can restore backups from the remote S3 storage to your Cloud Compute instance in case you accidentally delete files. Use the following syntax.

$ rclone copy remote_s3_storage local_storage

You can directly restore the backup files to the original source directory or download them to a temporary directory for review.

  1. Delete the original files from the local storage.

    $ rm ~/project/test1.txt ~/project/test2.txt ~/project/test3.txt
  2. Ensure the local storage directory is empty.

    $ ls -ls ~/project


    total 0
  3. Run the following Rclone copy command to download the files from the S3 storage to the local directory. Replace your-s3-bucket with the correct Vultr Object Storage bucket name.

    $ rclone copy s3-storage:your-s3-bucket/project ~/project
  4. Review the content of the local storage directory.

    $ ls -ls ~/project


    4 -rw-rw-r-- 1 ... 75 May 27 11:18 test1.txt
    0 -rw-rw-r-- 1 ...  0 May 27 11:09 test2.txt
    0 -rw-rw-r-- 1 ...  0 May 27 11:43 test3.txt


This guide took you through setting up automatic backups with Rclone and Vultr Object Storage. You have installed and configured Rclone in a Vultr Cloud Compute instance. Then, you have used the Rclone copy command to run manual backups. In the end, you have automated backups using the Linux crontab Jobs and restored backup files.