Avatar of sypder
sypder

asked on 

Setting tail -n 1 to ignore blank files

I am currently using the follow command as part of a cron job.

tail -n 1 /var/www/vhosts/*/statistics/logs/error*log > /var/www/vhosts/summary.log/error-log.txt

This works great, but when some of the error*log files are empty, I get empty lines from tail. Is it possible to have tail ignore empty files?
Linux

Avatar of undefined
Last Comment
sypder

8/22/2022 - Mon