From cfd2c33b645c5e73d56aebf4f9448d442579b8a8 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Mon, 4 May 2020 16:10:36 +0200 Subject: [PATCH] clean-up of log files --- docker/my-dojo/dojo.sh | 2 + docker/my-dojo/install/upgrade-scripts.sh | 48 +++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/docker/my-dojo/dojo.sh b/docker/my-dojo/dojo.sh index f40ab22..0844a3e 100755 --- a/docker/my-dojo/dojo.sh +++ b/docker/my-dojo/dojo.sh @@ -322,6 +322,8 @@ upgrade() { fi # Start Dojo docker_up --remove-orphans + # Post start clean-up + post_start_cleanup # Update the database update_dojo_db # Display the logs diff --git a/docker/my-dojo/install/upgrade-scripts.sh b/docker/my-dojo/install/upgrade-scripts.sh index e4edc68..c342ac1 100755 --- a/docker/my-dojo/install/upgrade-scripts.sh +++ b/docker/my-dojo/install/upgrade-scripts.sh @@ -128,6 +128,40 @@ update_dojo_db() { # Clean-up cleanup() { + ################# + # Clean-up v1.6.0 + ################# + + # Remove docker volume my-dojo_data-explorer + explorerVolumeFound=$(docker volume ls | grep my-dojo_data-explorer | wc -l) + if [ $explorerVolumeFound -ne 0 ]; then + explorerContainerFound=$(docker container ls -a | grep explorer | wc -l) + if [ $explorerContainerFound -ne 0 ]; then + docker container rm explorer + fi + docker volume rm my-dojo_data-explorer + fi + + # Remove docker volume my-dojo_data-nginx + nginxVolumeFound=$(docker volume ls | grep my-dojo_data-nginx | wc -l) + if [ $nginxVolumeFound -ne 0 ]; then + nginxContainerFound=$(docker container ls -a | grep nginx | wc -l) + if [ $nginxContainerFound -ne 0 ]; then + docker container rm nginx + fi + docker volume rm my-dojo_data-nginx + fi + + # Remove docker volume my-dojo_data-nodejs + nodeVolumeFound=$(docker volume ls | grep my-dojo_data-nodejs | wc -l) + if [ $nodeVolumeFound -ne 0 ]; then + nodeContainerFound=$(docker container ls -a | grep nodejs | wc -l) + if [ $nodeContainerFound -ne 0 ]; then + docker container rm nodejs + fi + docker volume rm my-dojo_data-nodejs + fi + ################# # Clean-up v1.3.0 ################# @@ -147,3 +181,17 @@ cleanup() { fi } + +# Post start clean-up +post_start_cleanup() { + ################# + # Clean-up v1.6.0 + ################# + + # Remove debug.log from bitcoind volume + if [ "$COMMON_BTC_NETWORK" == "testnet" ]; then + docker exec -it bitcoind rm /home/bitcoin/.bitcoin/testnet3/debug.log + else + docker exec -it bitcoind rm /home/bitcoin/.bitcoin/debug.log + fi +} \ No newline at end of file