Operating System - HP-UX
1753756 Members
4810 Online
108799 Solutions
New Discussion юеВ

Cronjob not running even in log showed the activities

 
SOLVED
Go to solution
AMIR-APM
Advisor

Cronjob not running even in log showed the activities

We have build HP-UX for test enviroment and the configuration is exactly same with our live production.Everything is goes fine but only cronjob is not running even in the cron log showed the activities.We execute command manually and it's work but failed with crontab.

Here some detail..

# ps -ef|grep cron
root 26628 1 0 11:12:52 ? 0:00 /usr/sbin/cron

Also performed below command but the cronjob still not working

/sbin/init.d/cron stop
/sbin/init.d/cron start

check permission for var\adm\cron ll
total 2016
-r--r--r-- 1 bin bin 51 Mar 26 2004 .proto
prw------- 1 root root 0 Jan 13 15:35 FIFO
-rw-r--r-- 1 root root 972990 Jan 13 11:02 OLDlog
-r--r--r-- 1 bin bin 18 Mar 26 2004 at.allow
-r--r--r-- 1 bin bin 29 Sep 11 14:57 cron.allow
-rw-r--r-- 1 root sys 15728 Jan 13 16:02 log
-r--r--r-- 1 bin bin 17 Mar 26 2004 queuedefs

crontab.allow also we added user to run the crontab but still no luck.

Crontab file
#TO RUN AND PROCESS BAPLIE EXTRACTION FOR MSK
2,22,42 * * * * /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/MSK/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_MSK

#TO RUN AND PROCESS BAPLIE EXTRACTION FOR APL
2,22,42 * * * * /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/APL/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_APL

#TO RUN AND PROCESS CODECO EXTRACTION FOR MSK
0,30 * * * * /home/express/BIN/edi_session.sh CODECO_MSK

#TO RUN AND PROCESS CODECO EXTRACTION FOR APL
0,30 * * * * /home/express/BIN/edi_session.sh CODECO_APL

#TO RUN AND PROCESS COARRI EXTRACTION FOR MSK
0,30 * * * * /home/express/BIN/edi_session.sh COARRI_MSK

#TO RUN AND PROCESS COARRI EXTRACTION FOR APL
0,30 * * * * /home/express/BIN/edi_session.sh COARRI_APL

crontab log

! *** cron started *** pid = 26628 Tue Jan 13 11:12:52 WAT 2009
> CMD: /usr/sbin/sendmail -q
> root 26631 c Tue Jan 13 11:15:00 WAT 2009
< root 26631 c Tue Jan 13 11:15:00 WAT 2009
> CMD: /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/MSK/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_MSK > /dev/null
> express 26722 c Tue Jan 13 11:22:00 WAT 2009
> CMD: /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/APL/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_APL > /dev/null
> express 26724 c Tue Jan 13 11:22:00 WAT 2009
< express 26724 c Tue Jan 13 11:22:01 WAT 2009
< express 26722 c Tue Jan 13 11:22:01 WAT 2009
> CMD: /home/express/BIN/edi_session.sh CODECO_MSK > /dev/null
> express 26989 c Tue Jan 13 11:30:00 WAT 2009
> CMD: /home/express/BIN/edi_session.sh CODECO_APL > /dev/null
> express 26991 c Tue Jan 13 11:30:00 WAT 2009
> CMD: /home/express/BIN/edi_session.sh COARRI_MSK > /dev/null
> express 26993 c Tue Jan 13 11:30:00 WAT 2009
> CMD: /home/express/BIN/edi_session.sh COARRI_APL > /dev/null
> express 26994 c Tue Jan 13 11:30:00 WAT 2009
> CMD: /home/express/BIN/edi_session.sh COARRI_HLL > /dev/null
> express 26996 c Tue Jan 13 11:30:00 WAT 2009

What should i do now.I have go through the forum but i still can't figure out the solution.Appreciate ur guy help.

Thanks

28 REPLIES 28
AMIR-APM
Advisor

Re: Cronjob not running even in log showed the activities

more info

# whereis cron
cron: /usr/sbin/cron /usr/share/man/man1m.Z/cron.1m
# ll /usr/sbin/cron
-r-xr-xr-x 1 bin bin 117508 Mar 31 2005 /usr/sbin/cron

# cat cron.allow
root
adm
uucp
express
oracle

# cat log
> CMD: /home/express/BIN/edi_session.sh CODECO_MSK
> express 3266 c Tue Jan 13 16:00:00 WAT 2009
> CMD: /home/express/BIN/edi_session.sh CODECO_APL
> express 3268 c Tue Jan 13 16:00:00 WAT 2009
> CMD: /home/express/BIN/edi_session.sh COARRI_MSK
> express 3270 c Tue Jan 13 16:00:00 WAT 2009
> CMD: /home/express/BIN/edi_session.sh COARRI_APL
> express 3271 c Tue Jan 13 16:00:00 WAT 2009
> CMD: /usr/sbin/sendmail -q
> root 3274 c Tue Jan 13 16:00:00 WAT 2009
< root 3274 c Tue Jan 13 16:00:00 WAT 2009
< express 3270 c Tue Jan 13 16:00:00 WAT 2009
< express 3266 c Tue Jan 13 16:00:00 WAT 2009
< express 3271 c Tue Jan 13 16:00:00 WAT 2009
< express 3268 c Tue Jan 13 16:00:00 WAT 2009
> CMD: /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/MSK/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_MSK
> express 3354 c Tue Jan 13 16:02:00 WAT 2009
> CMD: /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/APL/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_APL
> express 3356 c Tue Jan 13 16:02:00 WAT 2009
< express 3356 c Tue Jan 13 16:02:01 WAT 2009
< express 3354 c Tue Jan 13 16:02:01 WAT 2009
> CMD: /usr/sbin/sendmail -q
> root 3709 c Tue Jan 13 16:15:00 WAT 2009
< root 3709 c Tue Jan 13 16:15:00 WAT 2009
> CMD: /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/MSK/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_MSK
> express 3779 c Tue Jan 13 16:22:00 WAT 2009
> CMD: /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/APL/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_APL
> express 3781 c Tue Jan 13 16:22:00 WAT 2009
< express 3779 c Tue Jan 13 16:22:01 WAT 2009
< express 3781 c Tue Jan 13 16:22:01 WAT 2009

but the cronjob still not running..
sujit kumar singh
Honored Contributor
Solution

Re: Cronjob not running even in log showed the activities

hi

what is the original coammand line syantax that is Executing successfully from the command line can u tell the whole of the command line that u r able successfully execute from the command line?


Regrds
Sujit
Robert-Jan Goossens_1
Honored Contributor

Re: Cronjob not running even in log showed the activities

Hi,

Did you setup the shell environment for the user? For example the PATH setting.

Robert-Jan
sujit kumar singh
Honored Contributor

Re: Cronjob not running even in log showed the activities

hi and also which normal user is able to excute that complete command successfully from the command line.

Hope that u are not using the root user to execute those commands.


Regards
Sujit
AMIR-APM
Advisor

Re: Cronjob not running even in log showed the activities

There is 6 command line.I have try run all the command manually and works.

1) /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/MSK/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_MSK
2)/home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/APL/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_APL
3)/home/express/BIN/edi_session.sh CODECO_MSK
4)/home/express/BIN/edi_session.sh CODECO_APL
5)/home/express/BIN/edi_session.sh COARRI_MSK
6)/home/express/BIN/edi_session.sh COARRI_APL
AMIR-APM
Advisor

Re: Cronjob not running even in log showed the activities

i'm using "express" user to execute the command.From the log show u the details.

In cron.allow i also added user express to execute the cronjob
sujit kumar singh
Honored Contributor

Re: Cronjob not running even in log showed the activities

hi


make an entry in the crontab file using the command #crontab -e
and put the following line in there as follows:


0,30 * * * * su - express -c "/home/express/BIN/edi_session.sh CODECO_APL"


try running cron with this entry
and make sure that in the profile of "express" user u have the path added to
/home/express/BIN.
add this path in the pofile of the express user as

PATH=$PATH:/home/express/BIN
export PATH


regards
sujit
AMIR-APM
Advisor

Re: Cronjob not running even in log showed the activities

Hi,

Did you setup the shell environment for the user? For example the PATH setting.

Robert-Jan

Hi robert..
i've run set | grep express and show the path

EXP_PATH=/home/express/bin:/home/express/BIN
AMIR-APM
Advisor

Re: Cronjob not running even in log showed the activities

Hi sujit.

No luck.i've made a changes as below but cronjob still not running

crontab file

bahora1(express)$ crontab -l
0,5 * * * * su - express -c "/home/express/BIN/edi_session.sh CODECO_MSK"
0,5 * * * * su - express -c "/home/express/BIN/edi_session.sh CODECO_APL"
0,5 * * * * su - express -c "/home/express/BIN/edi_session.sh COARRI_MSK"
0,5 * * * * su - express -c "/home/express/BIN/edi_session.sh COARRI_APL"
2,22,42 * * * * su - express -c "/home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/APL/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_APL"
2,22,42 * * * * su - express -c "/home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/MSK/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_MSK"


log
> CMD: su - express -c "/home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/APL/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_APL"
> express 5182 c Tue Jan 13 17:22:00 WAT 2009
> CMD: su - express -c "/home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/MSK/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_MSK"
> express 5184 c Tue Jan 13 17:22:00 WAT 2009
< express 5184 c Tue Jan 13 17:22:02 WAT 2009 rc=9
< express 5182 c Tue Jan 13 17:22:02 WAT 2009 rc=9