Skip to content

Backup & Restore

Backup system

Components

Component Description
Restic 0.16.4 Incremental Backup Tool
Backup script /etc/xynap/backup/xynap-backup.sh
Backup repo /var/lib/xynap/backups/repo(local)
Cron Daily 03:00

What is secured

  • MariaDB databases (all)
  • Customer data (/var/lib/xynap/customers/)
  • Mail data (/var/lib/xynap/mail/)
  • Configuration (/etc/xynap/)
  • SSL certificates

Retention

Period Storage
Right 30 days
Weekly 12 weeks
Monthly 6 months

Manual backup

# Backup manuell starten
sudo /etc/xynap/backup/xynap-backup.sh

# Backup-Status pruefen
sudo restic -r /var/lib/xynap/backups/repo snapshots

Restore

# Snapshot auflisten
sudo restic -r /var/lib/xynap/backups/repo snapshots

# Dateien wiederherstellen
sudo restic -r /var/lib/xynap/backups/repo restore <snapshot-id> \
  --target /tmp/restore --include "/path/to/file"

# DB-Dump wiederherstellen
mysql -u root < /tmp/restore/path/to/dump.sql

Platform API Backup Management

# Backups auflisten
GET /api/v1/backups

# Backup-Schedules
GET /api/v1/backups/schedules
POST /api/v1/backups/schedules
{"name": "Nightly", "cron": "0 3 * * *", "type": "full"}

# Backup manuell triggern
POST /api/v1/backups/trigger/{schedule_id}

Telegram notification

After each backup, a status message is sent (following/error, gross, duration).