Re: Oh where oh where is STDOUT
- From: Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx>
- Date: Thu, 19 Oct 2006 07:09:46 +0200
"Klaatu62" <klaatu62@xxxxxxxxxxx> writes:
OK I've researched this to death, and not found an answer...
We have about 500 scripts that are run out of TIVOLI job manager. Each
run causes the STDOUT to be redirected to a new file in a directory
that has the current date as it's name.
The problem is that when a job has run for several days, there is no
way other than grepping through thousands of STDLIST files in 3, 4, 10,
20 directories, looking for where the task is outputting.
I was thinking that there should be a way for the running script to
output the current name of its STDOUT. That way, I could do something
like:
echo "$0 running as of $date and outputting to $STDOUT">>$stdlogfile
It's a way. But a big problem with your naming scheme is that two
processes started at the same time (within one second) will have the
same output file. (Two processes with the same PID within the same
second should very rarely occur, but with the fast processors nowdays,
it's not totally impossible, if the kernel doesn't do anything special
to prevent it).
You should try to make up unique names for the output; something like:
output_name=$(mktemp $(date +%Y%m%dT%H%M%S)-${PID}-XXXXXX)
for example:
for PID in 101 102 103 104 105 101 102 103 104 105 ; do
( output_name=$(mktemp $(date +%Y%m%dT%H%M%S)-${PID}-XXXXXX) ;\
sleep 3 ; echo $output_name ) & done ; echo ''
20061019T070635-101-rkTioS
20061019T070635-101-vexGPR
20061019T070635-105-anFxmW
20061019T070635-104-TLNDHY
20061019T070635-105-Ca2xz0
20061019T070635-103-2TRhn0
20061019T070635-102-kTZjC1
20061019T070635-102-Eu8UD9
20061019T070635-103-QkRKR9
20061019T070635-104-f1wSU7
This way, when you want the output of a process, you can easily find
it by PID.
--
__Pascal Bourguignon__ http://www.informatimago.com/
The mighty hunter
Returns with gifts of plump birds,
Your foot just squashed one.
.
- Follow-Ups:
- Re: Oh where oh where is STDOUT
- From: Klaatu62
- Re: Oh where oh where is STDOUT
- References:
- Oh where oh where is STDOUT
- From: Klaatu62
- Oh where oh where is STDOUT
- Prev by Date: Re: Oh where oh where is STDOUT
- Next by Date: Re: a.out and elf file format
- Previous by thread: Re: Oh where oh where is STDOUT
- Next by thread: Re: Oh where oh where is STDOUT
- Index(es):
Relevant Pages
|
|