From dd60d883b76fc89519f010e11b0a6179bc3a8f2e Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Thu, 18 Jan 2018 18:12:40 +0100 Subject: [PATCH] avoid commas in dump files --- docker-tools/restore.sh | 2 +- docker-tools/run.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-tools/restore.sh b/docker-tools/restore.sh index 9746b56..1dcbfaa 100755 --- a/docker-tools/restore.sh +++ b/docker-tools/restore.sh @@ -1,4 +1,4 @@ #!/bin/sh docker build -t eventman-dump-and-restore . -docker run --name eventman-restore --rm --network="eventman_default" -v `pwd`:/data --link=eventman_eventman-mongo_1:eventman-mongo eventman-dump-and-restore --restore $1 +docker run --name eventman-restore --rm --network="eventman_default" -v `pwd`:/data --link=eventman_eventman-mongo_1:eventman-mongo eventman-dump-and-restore --restore "$1" diff --git a/docker-tools/run.sh b/docker-tools/run.sh index 963c0d8..d8d4fd8 100755 --- a/docker-tools/run.sh +++ b/docker-tools/run.sh @@ -13,14 +13,14 @@ elif [ "${cmd}" = "--dump" ] ; then echo "INFO: dumping..." mongodump --host mongo --out /tmp/ --db eventman || (echo "ERROR: unable to dump the database" ; exit 10) cd /tmp - tar cfz /data/eventman-dump-`date +'%Y-%m-%dT%H:%M:%S'`.tgz eventman + tar cfz /data/eventman-dump-`date +'%Y-%m-%dT%H.%M.%S'`.tgz eventman --force-local elif [ "${cmd}" = "--restore" ] ; then if [ -z "$2" ] ; then echo "ERROR: missing argument to --restore" exit 20 fi echo "INFO: restoring $2..." - tar xfz "/data/$2" -C /tmp || (echo "ERROR: error unpacking file" ; exit 21) + tar xfz "/data/$2" -C /tmp --force-local || (echo "ERROR: error unpacking file" ; exit 21) mongo --host mongo eventman --eval "db.dropDatabase()" || (echo "ERROR: error dropping the database" ; exit 22) mongorestore --host mongo -d eventman /tmp/eventman else