]> apps.delaporte.us Git - matrix-cadbury.git/commitdiff
Add backup script and cron
authorEdward Delaporte <edward@delaporte.us>
Wed, 8 Apr 2026 01:43:40 +0000 (20:43 -0500)
committerEdward Delaporte <edward@delaporte.us>
Wed, 8 Apr 2026 01:43:40 +0000 (20:43 -0500)
service/backup.sh [new file with mode: 0755]
service/crontab [new file with mode: 0644]

diff --git a/service/backup.sh b/service/backup.sh
new file mode 100755 (executable)
index 0000000..7dd1753
--- /dev/null
@@ -0,0 +1,8 @@
+# Avoid corruption by stopping Cadbury
+systemctl stop cadbury
+INSTALL_DIR=/etc/matrix-cadbury
+# Create backup files while Cadbuary is paused
+mkdir -p $INSTALL_DIR/backups
+cp $INSTALL_DIR/*.db $INSTALL_DIR/backups
+# Resume Cadbury
+systemctl start cadbury
diff --git a/service/crontab b/service/crontab
new file mode 100644 (file)
index 0000000..ac9998b
--- /dev/null
@@ -0,0 +1 @@
+0 0 * * * /etc/matrix-cadbury/service/backup.sh