Operating System - HP-UX
1834228 Members
2675 Online
110066 Solutions
New Discussion

standard crontab message redirection

 
SOLVED
Go to solution
Maciej Szewczykowski
Frequent Advisor

standard crontab message redirection

hi all,
i'd like to ask for help in the following matter:
how to redirect standard message generated by crontab? each time after the commands are executed by crontab, standard message is written in /var/adm . i'd like to have the messages written in users home directory.
thanks.
3 REPLIES 3
Yogeeraj_1
Honored Contributor

Re: standard crontab message redirection

hi,

i do it this way:
============================================================
#*******************************************************************************
# min|hour |day |month|day |script
# | |of mo| |of wk|
#----|-----|-----|-----|-----|--------------------------------------------------
#*******************************************************************************
0,5,10,15,20,25,30,35,40,45,50,55 * * * * my_scr.sh 1>/home/yogeeraj/logfiles/output-myscr.crn 2>/home/yogeeraj/logfiles/error-myscr.crn

#*******************************************************************************
# min|hour |day |month|day |script
# | |of mo| |of wk|
#----|-----|-----|-----|-----|--------------------------------------------------
#*******************************************************************************
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************

============================================================

hth
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Balaji N
Honored Contributor

Re: standard crontab message redirection

standard redirection works in crontab as well. just redirect the standard o/p and standard error to files of ur choice.


hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
john korterman
Honored Contributor
Solution

Re: standard crontab message redirection

Hi,
you can redirect the output of the users jobs to what you want, but the messages in /var/adm/cron/log concerning the run of the jobs themselves cannot be redirected - at least not with 100% guarentee. If you do not redirect the output from the cron jobs themselves it is mailed to the user who executes the job.

regards,
John K.
it would be nice if you always got a second chance