Backing up our files is a crucial task that we don't consider until it's too late. Using rclone, we can make a backup of all our data stored in S3 buckets.
Installing rclone
First, we need to install rclone. We'll be using Ubuntu Server, but you can use any distribution supported.
curl https://rclone.org/install.sh | sudo bash
Once we've installed it, we can verify it.
rclone version
rclone v1.72.1
- os/version: ubuntu 24.04 (64 bit)
- os/kernel: 6.8.0-90-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.25.5
- go/linking: static
- go/tags: none
Configure the remote
To connect to our S3 storage, we must create a rclone remote.
rclone config
This command will prompt us to answer a few questions to configure it correctly.
Some options may differ from this example, so take your time reviewing the options offered to select the one that best suits your case.
n) New remote
name> s3-storage
Storage> s3
provider> Other
env_auth> false
access_key_id> ACCESS_ID_KEY
secret_access_key> ACCESS_SECRET_KEY
region> REGION
endpoint> http://s3.example.com
location_constraint>
acl> private
y/e/d> y
e/n/d/r/c/s/q> q
Test the remote
Once we've configured the remote, we need to test it. Running the following command should list all buckets available:
rclone lsd s3-storage:
-1 2026-01-29 21:09:35 -1 bucket-1
-1 2026-01-29 20:05:31 -1 bucket-2
Configuring the backup
To back up the S3 storage, we'll create a backup script.
vi /usr/local/bin/s3-backup.sh
#!/bin/bash
set -e
LOG="/var/log/rclone-backup.log"
DEST="/backup"
rclone sync garage: "$DEST" \
--checksum \
--fast-list \
--s3-no-check-bucket \
--transfers=8 \
--checkers=16 \
--log-file="$LOG" \
--log-level INFO
This script will back up all S3 buckets to the /backup folder.
Next, we make the script executable.
chmod +x /usr/local/bin/s3-backup.sh
And run it to create the first backup.
s3-backup.sh
Set up a cron job
To run the backup periodically, we must create a cron job.
crontab -e
# Backup Garage S3 to QNAP daily at 02:00.
0 2 * * * /usr/local/bin/s3-backup.sh
This cron job will run the backup script every day at 02:00.
Top comments (0)