I've a MapServer logfile; it is created in /tmp/mapserv.log
, but obviously it is flushed at every reboot, and is created only when a loggable event occurs.
I'm already using Multitail, but now I need to watch the folder /tmp
for a file that has not even been created, waiting for it to appear.
Any hint?
Best Answer
You could perhaps use the
-iw
option. It check for new files matching a given pattern at a given interval. When one is found start following it.E.g.:
Would look for the file
/tmp/mapserv.log
every 2 seconds. If and when it appears follow it.It is meant to take a wildcard as in
but works for non-wildcard as well. The number is how often to check for new files matching the pattern.
Else,
touch
could perhaps work. Might require something likesu user -c 'touch ...'
or achown
etc after touch.If MapServer deletes existing
mapserv.log
on first logging and not truncate or append you would perhaps also need the-f
option, as in: