diff --git a/build/templates/blockbook/logrotate.sh b/build/templates/blockbook/logrotate.sh index 267e1bdc78..56fe166d8d 100755 --- a/build/templates/blockbook/logrotate.sh +++ b/build/templates/blockbook/logrotate.sh @@ -4,10 +4,10 @@ set -e LOGS={{.Env.BlockbookInstallPath}}/{{.Coin.Alias}}/logs -find $LOGS -mtime +7 -type f -print0 | while read -r -d $'\0' log; do +find "$LOGS" -mtime +7 -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 + if ! fuser -s -- "$log"; then + rm -f -- "$log" fi done {{end}}