diff --git a/db-backup.sh b/db-backup.sh index 3a95b05..429bacd 100644 --- a/db-backup.sh +++ b/db-backup.sh @@ -1,7 +1,7 @@ #!/bin/sh docker-compose exec mongodb rm /tmp/openflow.bak docker-compose exec mongodb /usr/bin/mongodump --db openflow --gzip --archive=/tmp/openflow.bak -docker compose cp mongodb:/tmp/openflow.bak . +docker-compose cp mongodb:/tmp/openflow.bak . current_time=$(date "+%Y.%m.%d-%H.%M.%S") echo "Current Time : $current_time" cp openflow.bak openflow.$current_time.bak diff --git a/db-restore.sh b/db-restore.sh index ce43897..aa838cc 100644 --- a/db-restore.sh +++ b/db-restore.sh @@ -1,3 +1,3 @@ #!/bin/sh -docker compose cp openflow.bak mongodb:/tmp/ -docker-compose exec mongodb /usr/bin/mongorestore --gzip --archive=/tmp/openflow.bak +docker-compose cp openflow.bak mongodb:/tmp/ +docker-compose exec mongodb /usr/bin/mongorestore --gzip --archive=/open/openflow.bak