Backup Witness Node Online - Simple Bash Script to Show Logs

in witness-category •  last year 

I managed to restore the backup node quickly thanks to the Backup Data provided by @ety001 https://files.steem.fans

And here is a simple script to parse the logs and print it to the console:

#!/bin/bash

docker_name=$(docker ps | tail -1 | awk '$2=="steem" {print $1}')
if [[ -z "$docker_name" ]]; then
        echo "steem container not found!"
        exit 1
fi

while :; do
       last_line=$(docker logs $docker_name | tail -1)
       handle_block=$(echo $last_line | awk '{print $3}')
       block=$(echo $last_line | awk '{print $10}')
       if [[ $handle_block=="handle_block" ]]; then
              echo $handle_block=$block
       fi
       sleep 3
done

The idea is to find out the running container id of the steemd, and then print the logs by filtering out the "handle_block".

So, you will see simple logs like this:

image.png

Steem to the Moon🚀!

  • You can swap the STEEM/SBD to Tether USDT (TRC-20) via steem2usdt!
  • You can swap the STEEM/SBD to TRX (TRON) via steem2trx!
  • You can swap the STEEM/SBD to BTS (BitShares) via steem2bts!
  • Register a free STEEM account at SteemYY!
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!