From 3c0f2f74d48507cb4e886d6ddc5d839b10ae3503 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 18 Apr 2024 04:50:31 +0100 Subject: Adds wekan backup script for rimsky --- backup_wekan.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 backup_wekan.sh 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 -- cgit v1.2.3