Backing up Digital Ocean Spaces with rclone

Fremantle

I have a few wikis that use the AWS extension for storing their files. This means I can use Digital Ocean's Spaces object storage (which is S3 compatible). It's worked pretty well for a few years now.

I use Rclone to back up the Spaces buckets. Each wiki has a config section in ~/.config/rclone/rclone.conf, such as the following:

[digitalocean-wikiname]
type = s3
provider = DigitalOcean-wikiname
env_auth = false
endpoint = sgp1.digitaloceanspaces.com
acl = private
secret_access_key = SECRETKEY
access_key_id = ACCESSKEY

This means that the backup script can use that config (and also avoid backing up the thumb/ directory, because that can be re-built for these wikis):

echo "Downloading wikiname"
rclone sync --progress digitalocean:wikiname \
    --s3-endpoint=sgp1.digitaloceanspaces.com \
    --exclude="/thumb/**" \
    "/var/backups/digitalocean/wikiname/"