Skip to content

Commit

Permalink
add clean_logs command
Browse files Browse the repository at this point in the history
  • Loading branch information
Someguy123 committed Apr 9, 2020
1 parent 8cf462d commit e0c6ba4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,15 @@ pclogs() {
done
}

# Original grep/sed snippet made by @drakos
clean-logs() {
msgerr cyan "Monitoring and cleaning replay logs for ${DOCKER_NAME}"

docker logs --tail=5000000 -f -t "$DOCKER_NAME" | \
grep -E '[0-9]{2}%.*M free|[0-9]{2}%.*objects cached|Performance report at block|Done reindexing|Migrating state to disk|Converting index.*to mira type' | \
sed -e "s/\r\x1B\[0m//g"
}

# Usage: ./run.sh tslogs
# (warning: may require root to work properly in some cases)
# Shows the Steem logs, but with UTC timestamps extracted from the docker logs.
Expand Down Expand Up @@ -2209,6 +2218,9 @@ case $1 in
tslogs)
tslogs
;;
clean_logs|cleanlogs|clean-logs)
clean-logs
;;
ver|version)
ver
;;
Expand Down

0 comments on commit e0c6ba4

Please sign in to comment.