Backups with rclone
rclone transfers and syncs files with object storage and speaks any S3-compatible API, including chili. If you already use rclone for AWS S3, you only change the endpoint and keys.
Prerequisites
- rclone 1.60 or newer (
rclone version) - chili access keys (access key and secret key) from the chili Console
- a bucket, created in the chili Console, for example with the template
rclone or scripts
1. Configure the remote
In ~/.config/rclone/rclone.conf:
[chili]
type = s3
provider = Other
access_key_id = AKIA...
secret_access_key = ...
endpoint = https://s3-ch-east.chilistorage.comTest the connection:
rclone lsd chili:2. Back up data
# copy: transfers only new and changed files, never deletes at the target
rclone copy /data chili:my-backup --transfers 8 --checksum --progresssync mirrors the target exactly to the source and deletes what is missing there. Always check a sync with --dry-run first:
rclone sync /data chili:my-backup --transfers 8 --checksum --dry-run--checksum compares by checksum rather than timestamp and size. For backups, that is the more reliable choice.
3. Immutable backups
Object Lock (WORM) is set server-side on the bucket, not by rclone. For this, create the bucket in the chili Console with Object Lock enabled and the retention period Fixed period, and every uploaded object inherits the lock automatically. That keeps a backup immutable even if the machine that wrote it is compromised. Setup details are on the Object Lock page.
4. Automate
# /etc/cron.d/chili-backup (daily at 02:30)
30 2 * * * backupuser rclone copy /data chili:my-backup \
--transfers 8 --checksum --log-file /var/log/chili-backup.logVerify
Restore a few files from the bucket to a local directory with rclone copy and compare the contents. Restores cost nothing on chili, because there are no egress fees.