github.com/trezor/blockbook@v0.4.1-0.20240328132726-e9a08582ee2c/build/templates/blockbook/logrotate.sh (about) 1 {{define "main" -}} 2 #!/usr/bin/env bash 3 set -e 4 5 LOGS={{.Env.BlockbookInstallPath}}/{{.Coin.Alias}}/logs 6 7 find $LOGS -mtime +7 -type f -print0 | while read -r -d $'\0' log; do 8 # remove log if isn't opened by any process 9 if ! fuser -s $log; then 10 rm -f $log 11 fi 12 done 13 {{end}}