Remove sub-directories in /mongo-export

On Digital Ocean a persistent volume has a folder `lost+found` by
default. This script stops throws error messages because it can't remove
that folder if we don't add `-r` flag.
This commit is contained in:
Robert Schäfer 2019-02-04 12:37:03 +01:00
parent 2c0110b63f
commit 064e98943d

View File

@ -18,7 +18,7 @@ echo "UPLOADS_DIRECTORY ${UPLOADS_DIRECTORY}"
echo "-------------------------------------------------"
mongo ${MONGODB_DATABASE} --eval "db.dropDatabase();"
rm -f /mongo-export/*
rm -rf /mongo-export/*
ssh -4 -M -S my-ctrl-socket -fnNT -L 27018:localhost:27017 -l ${SSH_USERNAME} ${SSH_HOST}
mongodump --host localhost -d ${MONGODB_DATABASE} --port 27018 --username ${MONGODB_USERNAME} --password ${MONGODB_PASSWORD} --authenticationDatabase ${MONGODB_AUTH_DB} --gzip --archive | mongorestore --gzip --archive