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 ?

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

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.