sokko-g/ops/systemd/sokko-g-cards-backup.service
Shinuwa 115e62d5b2 Make Cards database restores reliable and schedule backups
A restore left the replaced database's write-ahead log in place, so SQLite
replayed it and the restored file silently kept later writes. Restores now
remove it, backups stay single files, and a systemd timer keeps 14 daily copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 17:54:17 +01:00

11 lines
529 B
Desktop File

# Rôle : sauvegarde la base Sokko TCG et garde les 14 dernières copies quotidiennes, seulement si le jeu a déjà une base.
[Unit]
Description=Sokko G Cards database backup
ConditionPathExists=/var/lib/sokko-g/cards/nebula-cards.sqlite
[Service]
Type=oneshot
User=shinuwa
WorkingDirectory=/data/webapps/sites/sokko-g
Environment=NODE_ENV=production
ExecStart=/home/shinuwa/.nvm/versions/node/v24.11.1/bin/node scripts/backup-nebula-cards.mjs scheduled /var/lib/sokko-g/cards/nebula-cards.sqlite /var/backups/sokko-g --keep 14