Something went wrong. Try again.
A free, open-source, self-hosted place to write a novel.
Something went wrong. Try again.
1.4 kB · 44 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445# A weekly backup of a Fablewright instance, for a bare Node install.## 1. Install: cp deploy/fablewright-backup.service deploy/fablewright-backup.timer /etc/systemd/system/# 2. Enable: systemctl daemon-reload && systemctl enable --now fablewright-backup.timer# 3. Copy the backups in /var/lib/fablewright/backups off the machine.## The backup runs beside the app, as the same user, and reads the same# environment. It does not stop the app: the tool copies a live database with# SQLite's own VACUUM INTO. A backup on the same disk is not a backup, so this# unit writes the file and stops there. Copying it elsewhere is the job that makes# it one.
[Unit]Description=Back up a Fablewright instanceDocumentation=https://tangled.org/katsuricata.com/FablewrightAfter=fablewright.service
[Service]Type=oneshotUser=fablewrightGroup=fablewrightWorkingDirectory=/opt/fablewright
StateDirectory=fablewrightStateDirectoryMode=0750
Environment=DATABASE_URL=file:/var/lib/fablewright/fablewright.dbEnvironment=DATA_DIR=/var/lib/fablewright
ExecStart=/usr/bin/node /opt/fablewright/scripts/ops.mjs backup --keep 8
NoNewPrivileges=yesPrivateTmp=yesPrivateDevices=yesProtectSystem=strictProtectHome=yesProtectKernelTunables=yesProtectKernelModules=yesProtectControlGroups=yesRestrictAddressFamilies=AF_UNIXRestrictNamespaces=yesLockPersonality=yesMemoryDenyWriteExecute=yesReadWritePaths=/var/lib/fablewright