diff --git a/db-backup.sh b/db-backup.sh new file mode 100644 index 0000000..3a95b05 --- /dev/null +++ b/db-backup.sh @@ -0,0 +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 . +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 new file mode 100644 index 0000000..ce43897 --- /dev/null +++ b/db-restore.sh @@ -0,0 +1,3 @@ +#!/bin/sh +docker compose cp openflow.bak mongodb:/tmp/ +docker-compose exec mongodb /usr/bin/mongorestore --gzip --archive=/tmp/openflow.bak