Skip to content

Automated snapshots with rclone and cron

VPS Hosting by hankels 23 replies 2.3K views
#1

Mini-guide time. I run 52 boxes so snapshot automation is life or death by $/GB/RAM.

rclone sync /var/backups remote:bucket --backup-dir=remote:archive/$(date +%Y%m%d)

Stick that in cron daily. Done. 😂

I use Vultr for storage since their egress is cheap. Lists:

- rclone config with s3 compat
- cron at 3am (who is awake then)
- --backup-dir for rotation

Problems: no health checks, no alerts, you only know it broke when you need it. Someone fix this please.

seedbox, NAS, tape, and three offsite
#2

Anyway here is what I do at 3am instead of sleeping

#!/bin/bash
RCLONE_RC=$(rclone rc core/stats 2>/dev/null)
Echo "$RCLONE_RC" | jq -e '.bytes' || exit 1

Idk why I do this. Checks if rclone daemon is actually responsive before sync. Add it before your cron job. 💀

builds at 3AM, sleeps at noon
#3

Actually this is good idea but basically I have never saw this before. In the internet there is many guides but this one is actually working for me. I add this to my script:

If! rclone ls remote:bucket &>/dev/null; then
Echo "this is not working"
Exit 1
Fi

Before this I have backup that was not actually backup because remote was down. 😂 thank you for this thread.

#4

Back in 2009 we had source engine servers crashing daily and no one automated backups. Kids play Valorant now, they do not know the pain of 33 tickrate with no snapshots. Your script reminds me of server cfg autoexecs—functional but you never know until the map changes. I would add a test restore monthly. Communities die when data dies.

#5

Right then, proper guide this is becoming. I use Hostinger — https://www.hostinger.com — and I see folk bodge cron jobs then cry when their VPS croaks. Here is my honest take: your script needs a health ping after. I lobbed together a webhook curl to Discord, nothing fancy. 🦡

curl -H "Content-Type: application/json" -d '{"content":"backup done on '"$(hostname)"'"}' YOUR_WEBHOOK

Cheers lads. Limit of their service: they do not manage your cron, so this is on you.

Honey badger don't care... about downtime
#6

Gatus in docker compose, reverse proxy behind Traefik, health check your rclone endpoint. I run this stack on a RackNerd ARM box costing pennies. Add to your compose:

Services:
Gatus:
Image: twinproduction/gatus
Volumes:
- ./config:/config

Monitor the backup job, alert via Matrix or whatever. Docker compose and reverse proxies solve everything if you stop relying on SaaS.

my cloud. my rules. my 3AM alerts.
#7

Matrix alerts? Most people can't even keep Synapse alive.

seedbox, NAS, tape, and three offsite
#8

Which arm box, the 4gb or 8gb drift one

42U and still growing
#9

SolusVM is a feature not a bug. Less to hack.

my cloud. my rules. my 3AM alerts.
#10

I have the 8GB in Amsterdam. 3.5GHz ARM cores, rclone crypts 200GB in 20 minutes flat. Only issue: RackNerd has no Stockholm DC so my latency to home is 35ms instead of 8. First world problem.

builds at 3AM, sleeps at noon

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft