Skip to content

Instantly share code, notes, and snippets.

@stackdump
Created April 17, 2019 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stackdump/cb661d836e2d89bc724c98538dd11aee to your computer and use it in GitHub Desktop.
Save stackdump/cb661d836e2d89bc724c98538dd11aee to your computer and use it in GitHub Desktop.

Add to your cron

crontab -e

Add a line like this

# m h  dom mon dow   command
0 * * * * /usr/sbin/logrotate /media/ork/berg/mainnet/logrotate.conf --state /media/ork/berg/mainnet/logrotate-state

Write a config file like this one

#/media/ork/berg/mainnet/logrotate.conf

/media/ork/berg/mainnet/*.txt {
    daily
    missingok
    rotate 24
    compress
    nocreate
}
@stackdump
Copy link
Author

the nocreate option was important - factomd stops writing logs otherwise

@stackdump
Copy link
Author

NOTE: also it's still possible to search compressed logs w/ zgrep

This snippet looks for EOM's that arrive before the local node has progressed to the next block

ork@gir:/media/ork/berg/mainnet$ cat eom_from_future.sh 
echo "current_ht<=>EOM"
zgrep -h EOM fnode0_holding.txt* \
  | awk '$4 == "add" { print $3 " " $9 }' \
  | sed 's/-/ /'g \
  | sed 's/\// /g' \
  | awk ' $1 != $4 {print $0}' \
  | awk '{ print $1 "<=>" $4}' \
  | sort -u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment