2017-06-26 17:04:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# get wekan/mongo settings
|
|
|
|
source $SNAP/bin/wekan-read-settings
|
|
|
|
|
|
|
|
# make sure we have set minimum env variables for locale
|
|
|
|
if [ -z "$LANG" ]; then
|
|
|
|
export LANG=en_US.UTF-8
|
|
|
|
fi
|
|
|
|
|
|
|
|
export LC_ALL=C
|
2025-06-26 02:41:11 +03:00
|
|
|
# If CPU does not support AVX, use Qemu that supports AVX.
|
|
|
|
# Migratemongo is at https://github.com/wekan/migratemongo
|
|
|
|
# and at directory /snap/${SNAP_NAME}/current/migratemongo/avx
|
|
|
|
# is bash scripts like mongod, mongosh check avx support and use Qemu if needed.
|
|
|
|
export PATH=/snap/${SNAP_NAME}/current/migratemongo/avx:/snap/${SNAP_NAME}/current/usr/bin:/snap/${SNAP_NAME}/current/bin:$PATH
|
2024-01-28 13:17:44 +02:00
|
|
|
export LD_LIBRARY_PATH=/snap/${SNAP_NAME}/current/lib:/snap/${SNAP_NAME}/current/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
|
2017-06-26 17:04:27 +00:00
|
|
|
|
|
|
|
# start mongodb backup
|
|
|
|
[ "x" == "x${MONGODB_BIND_IP}" ] && MONGODB_BIND_IP="127.0.0.1"
|
|
|
|
echo "using bind ip"
|
2019-08-06 22:02:23 +03:00
|
|
|
mongorestore --host $MONGODB_BIND_IP --port $MONGODB_PORT -d wekan --gzip --archive=$1
|
|
|
|
# --noIndexRestore
|