I run a program (egate, but does not matter in this) and I redirect the output using 1> and 2>
/pshrmcappkg1/app/egate/client/bin/stccb -rh gbdxgm04 -rs HP3000 -un Administrator -up STC -ln hp3000_cb -ss 1> /psmimcappkg1/app/log/egate/HP3000stdout.log 2> /psmimcappkg1/app/log/egate/HP3000stderr.log
This gives me 2, constantly growing log files, which is the whole idea.
BUT: the output gives NO indication of date/time whatsoever. so this log file is getting really fustrating if I need to find something.
So I want to add a date/time stamp to this log.
I tryed to do this using unix cron:
00,10,20,30,40,50 * * * *
echo "\r\nDATE & TIME: "`date -u '+%Y%m%d%H%M%S'` >> HP3000stdout.log
BUT: it seems so, that unix keep its fileposition, and overwrites the DATE & TIME again with its next log messages.
Now I am looking to a solution where we redirect to a script that adds date & time before writing the log, but I do not know if that is possible.
Any other ideas.