5

How do I tail a log file and keep tailing it when the latest one changes date?

view full story
linux-howto

http://unix.stackexchange.com – I'm using RHEL 4. The normal tail -F file_name*.log doesn't update when the time flips over to 0000. Here's what I've tried so far from searching the web, both of which try to use nested tail: tail -F $(ls -tr file_name*.log | tail -n 1) tail -F $(fine . -maxdepth 1 -type f -printf "%T@ %p\n" | sort -n | tail n 1 | cut -d' ' -f 2-) None of these flip over to new files. Plain old tail -F file_name*.log works in my small test cases (while the 2 above don't), but it doesn't work when I'm tailing a real log file. (HowTos)