Keeping std & err outputs alive and feed one log file in a one-shot way
Bonjour,
I have a large script with a lot of print statements and misc commands. Standard and error outputs are redirected like into the following code :
That way, standard and error outputs are added to the log file without appending >> {LOG} 2>>{LOG} after each print statement or command.
But now, we must execute these scripts via a new scheduler (VTOM) and still keep our ${LOG} file feeded.
The problem is that VTOM feeds its own logs with standard and error outputs so exec ... line must be commented.
My question : is there anyway to keep standard and error outputs alive for VTOM usage and feed too our UNIX log without appending redirections after each print statements and commands ?
ps : i've searched around tee command but without any good results. Maybe additional file descriptors may be used, but i've never worked with them.
Sorry when you say scheduler to me that means batchs... and so no terminals are attached... I understand better now... considered using tail -f /.../logfile ?
I would like to know if a command works.
"command" 2>/dev/null
When I issue the command, the error is suppressed. How can I tell whether there was an error? (3 Replies)
Hello gurus, this is part of my script:
ls -1 ${MyFile} >> ${dir_log}ListFile${Now}.tmp
FILENUM=`cat ${dir_log}ListFile${Now}.tmp| wc -l | awk '{print $1}'`>> /dev/null
if
then
writeError "ERRORE: no file in directory for type ${FileName}!" >> ${LogFileName}
Close 1
fi... (7 Replies)
Hello guys, I have one script running that I need to keep it running 24x7 so I'd like to know how can I implement a sort of monitoring process I mean if for some reason this process dies somehow it gets automatically started again.
Thanks. (8 Replies)
Hello All,
I am stuck with the follwing problem , pls give me some advice..
Input file:
input clock;
input reset; \\reset all
input yuv;
//input comment
output sur;
output sud;
output vtua;
output tur;
input ebi;
//output comment
The input file... (1 Reply)
My shell script file name is test.sh and the contents of this test.sh file are
ps_file="package1.ps"
echo $ps_file
ps_file1=`echo $ps_file| sed "s/.ps//g"`
echo $ps_file1
ps2pdf -dSAFER -sPAPERSIZE=a4 /tmp/A380_RFS24/amm_r0_ps/$ps_file1.ps /tmp/A380_RFS24/amm_r0_pdf/$ps_file1.pdf
Now i... (2 Replies)
Hello all
Im using CC: Sun C++ 5.6 2004/07/15 and using the -library=stlport4 when linkning im getting
The fallowing error :
Undefined first referenced
symbol in file
std::ostream &std::ostream::operator<<(std::ios_base&(*)(std::ios_base&))... (0 Replies)
The following command does not work under cygwin bash.
ant debug >log 2>&1 && ant image >>log 2>>&1 & pid=$!
It gives the error "-bash: sysntax error near unexpected token '&'".
Is there a way I can redirect std output and std error to file "log" for both the commands "ant debug" and "ant... (1 Reply)
Hi,
I'm very new to Unix so please bear with me... :)
Here is my requirement:
I need to create a cron job to run two different scripts at 1 a.m. every day.
Here's what I did:
I used the "crontab -e" command and created a crontab file using the vi editor.
When I exit the editor using... (3 Replies)
Hi
I want both standard output and standard error of my command cmd to go to the same file log.txt. please let me know the best commandline to do this.
Thanks (2 Replies)