| 123456789101112131415161718192021222324252627282930 | #!/bin/bash# get wekan/mongo settingssource $SNAP/bin/wekan-read-settings# make sure we have set minimum env variables for localeif [ -z "$LANG" ]; then    export LANG=en_US.UTF-8fiexport LC_ALL=C# 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:$PATHexport LD_LIBRARY_PATH=/snap/${SNAP_NAME}/current/lib:/snap/${SNAP_NAME}/current/lib/x86_64-linux-gnu:$LD_LIBRARY_PATHif [ -z $1 ]; then    DATE=`/bin/date +%Y%m%dT%H%M%S`    mkdir -p $SNAP_COMMON/db-backups/    ARCHIVE=$SNAP_COMMON/db-backups/wekan-$DATE.backupelse    ARCHIVE=$1fi# start mongodb backup[ "x" == "x${MONGODB_BIND_IP}" ] && MONGODB_BIND_IP="127.0.0.1" echo "using bind ip"mongodump --host $MONGODB_BIND_IP --port $MONGODB_PORT -d wekan --gzip  --archive=${ARCHIVE}
 |