4

I'm debugging a Linux application that allows remote jobs to be submitted, logging the output from each job in a new file. The log file paths conform to:

/joblogs/job_*/JOB.LOG

where the wild card represents the unique job number.

I want to be able to tail each job log, including new logs that are created after I issue the tail (or whatever) command. I thought I'd be able to do this using multitail, but I can't figure out the right set of parameters to use. For example,

multitail -q 1 "/joblogs/job_*/JOB.LOG"

seems to create a window for each new log file just the way I want, but it doesn't show any output in the file window.

Anyone know how to do this, either with multitail or another Linux tool ?

3 Answers 3

1

Since there is only one job active at a time, completed job logs are moved to /joblogs/completed_jobs/job_* and the logs are short, this hokey workaround is OK for now:

while [ 1 == 1 ] ; do for joblog in `ls /joblogs/job_*/JOB.LOG`; do cat $joblog; done; sleep 10; done
0

try removing the parameters and the quotes

1
  • Without the "-q 1", it didn't pick up new files that were created after the multitail command was issued. Commented Jan 22, 2010 at 2:39
0

like tail do you need to give it a -f flag to tell it to Follow the files?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .