Uploads ClimWeb backups to a cloud remote using a storage-efficient strategy:
| Backup type | Frequency | Retention | Typical size |
|---|---|---|---|
Database (.psql.bin) |
Daily | 10 days | ~3–5 MB/file |
Media (.tar) |
Weekly | 1 snapshot | varies |
Files are uploaded individually with date-stamped names — nothing is ever overwritten.
| Option | Free storage | Credit card? | Best for |
|---|---|---|---|
| Google Drive ⭐ | 15 GB (shared) | No | Sites with a dedicated Google account |
| OneDrive | 5 GB | No | Sites with a Microsoft/Office 365 account |
| Another server | — | No | Strict data sovereignty requirements |
For backing up to another server via rsync, see Backup To Remote Server Guide.
Uses OAuth — no credit card required, just a Google account. You run rclone authorize once on your local machine to generate a token, paste it into a config file on the server, and you're done.
Use a dedicated Google account for the site rather than someone's personal account. The 15 GB quota is shared with Gmail and Google Photos.
Mac:
brew install rcloneWindows: Download the installer from https://rclone.org/downloads/
Linux:
sudo -v ; curl https://rclone.org/install.sh | sudo bashOn your local machine:
rclone authorize "drive"Your browser will open automatically. Sign in with the site's Google account and approve access. Rclone prints the token to your terminal:
Paste the following into your remote machine --->
{"access_token":"ya29...","token_type":"Bearer","refresh_token":"1//...","expiry":"..."}
<---End paste
Copy that JSON (the {...} part).
On the server:
git clone https://github.com/wmo-raf/climweb-backup-sync.git
cd climweb-backup-syncCreate rclone/config/rclone.conf with the token you copied:
[gdrive]
type = drive
scope = drive.file
token = PASTE_TOKEN_JSON_HEREReplace PASTE_TOKEN_JSON_HERE with the {"access_token":...} JSON on a single line.
cp .env.sample .env
nano .envBACKUP_DIR=/home/user/climweb/climweb/backup
SITE_NAME=zambia
REMOTE_FOLDER=gdrive:ClimWeb Backups/
DB_RETENTION_DAYS=10
MEDIA_RETENTION_DAYS=3
MEDIA_UPLOAD_WEEKDAY=1docker compose up -d climweb-backup-rclone --buildDone. Backups will upload daily at midnight UTC.
Same approach as Google Drive — run rclone authorize locally once, paste the token into the server config.
See Option 1 Step 1.
On your local machine:
rclone authorize "onedrive"Your browser will open. Sign in with the Microsoft account. Copy the token JSON printed to your terminal.
On the server:
git clone https://github.com/wmo-raf/climweb-backup-sync.git
cd climweb-backup-syncCreate rclone/config/rclone.conf:
[onedrive]
type = onedrive
token = PASTE_TOKEN_JSON_HERE
drive_id = YOUR_DRIVE_ID
drive_type = personalTo find your
drive_id: runrclone configon your local machine, follow the OneDrive setup, and rclone will display and save the drive ID automatically. Copy the full[onedrive]section from~/.config/rclone/rclone.confto the server.
Note: OneDrive's free tier is 5 GB. With the default retention settings (~50 MB for DB + 1 weekly media snapshot) this is enough for most installations, but large media folders may require reducing
DB_RETENTION_DAYS.
cp .env.sample .env
nano .envBACKUP_DIR=/home/user/climweb/climweb/backup
SITE_NAME=zambia
REMOTE_FOLDER=onedrive:ClimWeb Backups/
DB_RETENTION_DAYS=10
MEDIA_RETENTION_DAYS=3
MEDIA_UPLOAD_WEEKDAY=1docker compose up -d climweb-backup-rcloneRun a backup manually:
docker exec -it climweb-backup-rclone /app/rclone_daily.shView logs:
docker logs climweb-backup-rclone
# or inside the container:
docker exec -it climweb-backup-rclone tail -f /var/log/backup.logEdit rclone/crontab (default: midnight UTC):
0 0 * * * /app/rclone_daily.sh >> /var/log/backup.log 2>&1
Rebuild after changes:
docker compose up -d --build climweb-backup-rcloneClimWeb Backups/ (your Google Drive or OneDrive folder)
db/
zambia-db-2026-05-23.psql.bin
zambia-db-2026-05-24.psql.bin
...
zambia-db-2026-05-27.psql.bin ← daily DB snapshots, ~3–5 MB each
media/
zambia-media-2026-05-26.tar ← 1 weekly media snapshot
rclone/config/rclone.confis git-ignored and should never be committed.- Make sure
climweb dbbackupandclimweb mediabackuprun before this container's cron job each day. The script uploads the most recent file it finds in the backup directory. - To keep more media snapshots, increase
MEDIA_RETENTION_DAYS— e.g.28keeps 4 weekly copies (uses ~4× the media file size on the remote).