aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-04-18 04:50:31 +0100
committerMatthew Lemon <y@yulqen.org>2024-04-18 04:50:31 +0100
commit3c0f2f74d48507cb4e886d6ddc5d839b10ae3503 (patch)
treea5b18e310b34ef301009cc0de4f79773efa62a37
parentffb352c90114443c3aee338ea8277713e87db506 (diff)
Adds wekan backup script for rimsky
-rwxr-xr-xbackup_wekan.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/backup_wekan.sh b/backup_wekan.sh
new file mode 100755
index 0000000..b7c8624
--- /dev/null
+++ b/backup_wekan.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+
+DATE=$(date -I)
+TARGET=wekan_database_backup_"$DATE"
+
+docker stop wekan-app
+docker exec wekan-db rm -rf /data/dump
+docker exec wekan-db mongodump -o /data/dump
+docker cp wekan-db:/data/dump "/tmp/$TARGET"
+docker start wekan-app
+
+tar -czf /mnt/matt/wekan_backups/wekan_backup_$DATE.tgz -C /tmp "$TARGET"
+rm -r "/tmp/$TARGET"
+
+# To restore:
+# docker stop wekan-app
+# docker exec wekan-db rm -rf /data/dump
+# docker cp dump wekan-db:/data/
+# docker exec wekan-db mongorestore --drop --dir=/data/dump
+# docker start wekan-app