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 ?

gareth_bowles
  • 8,867
  • 9
  • 33
  • 42

3 Answers3

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
gareth_bowles
  • 8,867
  • 9
  • 33
  • 42
0

try removing the parameters and the quotes

Andrew
  • 238
  • 1
  • 2
  • 5
0

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

BuildTheRobots
  • 842
  • 5
  • 11