-
Notifications
You must be signed in to change notification settings - Fork 1
backups
github-actions[bot] edited this page Mar 25, 2026
·
3 revisions
extras/backup/ backs up service configs to S3-compatible storage (e.g., DigitalOcean Spaces) using restic. Safely snapshots SQLite databases before backup.
# Install dependencies
apt install -y restic sqlite3
# Configure
cd extras/backup
cp .env.example .env # fill in your S3 credentials, restic password, and backup path
# Initialize restic repo (once)
set -a && source .env && set +a
restic init
# Test a backup
./backup-config.sh
# Schedule daily at 3 AM
(crontab -l 2>/dev/null; echo "0 3 * * * $(pwd)/backup-config.sh >> /var/log/restic-backup.log 2>&1") | crontab -cd extras/backup
set -a && source .env && set +a
restic snapshots # list snapshots
restic restore latest --target /tmp/restore # restore latest- Snapshots all SQLite
.dbfiles to.db.bakbefore backing up (prevents corruption) - Excludes live database files and journals (only the safe
.bakcopies are backed up) - Prunes old snapshots: keeps 7 daily, 4 weekly, 3 monthly
- Cleans up
.bakfiles after backup completes