aboutsummaryrefslogtreecommitdiffstats
path: root/backup_wekan.sh
diff options
context:
space:
mode:
Diffstat (limited to 'backup_wekan.sh')
-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