I'm using less to continuously trace Squid log file (as well as UFW log) with this command:
less --follow-name -K +F /var/log/squid/access.log
And at the time of rotation of Squid log less quits. I guess this happens because when an old file is renamed the new one is not created immediately but with a delay, though in the case of UFW log file this doesn't happen and less successfully switches to the new file.
So is there a method or option to make less wait for a new file to appear?
less
version 643 on Debian testing. Where I do see it waiting for the file to reappear whether I rename or delete the original.seq 1000 > file; less --follow-name -K +F file
, and then from another terminalrm file
ormv file file2
, and thenseq 100 > file
I can't reproduce it.(umask 666; seq 100 > file)
in which caseless
issues afile: Permission denied (press RETURN)
and exits when I press Returnless --follow-name -K +F /var/log/squid/access.log
and less successfully shows me the log file but when I open the console tab shortly after midnight I see less quit and I have to run the command again.