blockbook/build/templates/blockbook/logrotate.sh
2018-07-26 12:49:57 +02:00

14 lines
284 B
Bash
Executable File

{{define "main" -}}
#!/bin/bash
set -e
LOGS={{.Env.BlockbookInstallPath}}/{{.Coin.Alias}}/logs
find $LOGS -mtime +30 -type f -print0 | while read -r -d $'\0' log; do
# remove log if isn't opened by any process
if ! fuser -s $log; then
rm -f $log
fi
done
{{end}}