mongodb-restore 932 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. # get wekan/mongo settings
  3. source $SNAP/bin/wekan-read-settings
  4. # make sure we have set minimum env variables for locale
  5. if [ -z "$LANG" ]; then
  6. export LANG=en_US.UTF-8
  7. fi
  8. export LC_ALL=C
  9. # If CPU does not support AVX, use Qemu that supports AVX.
  10. # Migratemongo is at https://github.com/wekan/migratemongo
  11. # and at directory /snap/${SNAP_NAME}/current/migratemongo/avx
  12. # is bash scripts like mongod, mongosh check avx support and use Qemu if needed.
  13. export PATH=/snap/${SNAP_NAME}/current/migratemongo/avx:/snap/${SNAP_NAME}/current/usr/bin:/snap/${SNAP_NAME}/current/bin:$PATH
  14. export LD_LIBRARY_PATH=/snap/${SNAP_NAME}/current/lib:/snap/${SNAP_NAME}/current/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
  15. # start mongodb backup
  16. [ "x" == "x${MONGODB_BIND_IP}" ] && MONGODB_BIND_IP="127.0.0.1"
  17. echo "using bind ip"
  18. mongorestore --host $MONGODB_BIND_IP --port $MONGODB_PORT -d wekan --gzip --archive=$1
  19. # --noIndexRestore