- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cronjob not running even in log showed the act...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 08:46 AM
тАО01-13-2009 08:46 AM
Re: Cronjob not running even in log showed the activities
eg:
0,5 * * * * su - express -c "/home/express/BIN/edi_session.sh CODECO_MSK" >> /tmp/CODECO_MSK.out
Then you could check /tmp/CODECO_MSK.out to find out where it fails
Good Luck !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 08:55 AM
тАО01-13-2009 08:55 AM
Re: Cronjob not running even in log showed the activities
Your 'crontab -l' in your last post appears to have been run from the 'express' user.
If they are running as 'express' then your problem is likely the 'su - express' that you are doing.
The only user that will allow the 'su - express -c' syntax to work WITHOUT requesting a password is root.
If you are logged in as express and you try to 'su - express' then you will get prompted for a password. That is probably where your jobs are failing.
If this is really the crontab for the express user then omit the 'su - express -c' from the beginning of each line, and omit the quotes, so that they look like:
0,5 * * * * /home/express/BIN/edi_session.sh CODECO_MSK
0,5 * * * * /home/express/BIN/edi_session.sh CODECO_APL
0,5 * * * * /home/express/BIN/edi_session.sh COARRI_MSK
0,5 * * * * /home/express/BIN/edi_session.sh COARRI_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
2,22,42 * * * * /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/MSK/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_MSK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 09:27 AM
тАО01-13-2009 09:27 AM
Re: Cronjob not running even in log showed the activities
this is my orginal crontab file which fail in the fist place
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 09:48 AM
тАО01-13-2009 09:48 AM
Re: Cronjob not running even in log showed the activities
Let see where it fails
Instead of redirectly the output to /dev/null, please redirect it to a particular file which will allow us to know where it gets failed
Also from the post I could see the the cron logs shows that the script is completed sucessfully
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
< express 26722 c Tue Jan 13 11:22:01 WAT 2009
Please correct me ..
The above menthod of redirecting the output to some specific file will exactly let you know how the script goes ..
eg:
* * * * * /home/express/BIN/sweep2.sh /home/express/EDI/BAPLIE/MSK/IN/RECEIVAL /home/express/BIN/edi_load_post.sh BAPIN_MSK > /tmp/BAPIN_MSK.out
Check BAPIN_MSK.out and check if that is what the output your required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 09:51 AM
тАО01-13-2009 09:51 AM
Re: Cronjob not running even in log showed the activities
1) fix one at a time...what fixes one will probably fix the others
2) since you're trying to run them as "express" is "express" *allowed* to run cronjobs? check cron.allow
3) in the above, is this *one* job with *three* parms? It looks like it is supposed to be *2* jobs with *2* parms each
4) as noted before...are all the correct environment variables that are needed set within the script. cron strips the environment way down.
5) do any of the above work from the command line, and if so, what *exactly* do you enter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 10:39 AM
тАО01-13-2009 10:39 AM
Re: Cronjob not running even in log showed the activities
yes as oldschool says that , try using the changes that u make on one of the commands only, if that is successful that means that rest are successful.
also from logs it seems that ur cron is able to create the jobs successfully.
try rediredting the O/Ps to some file and see the O/p of those files.
if u want to use -c option as i had said earlier, try running the jobs as root.
also can for one of the commands try to redirect the O/P to some file and compare that O/P with what u get on the screen when u execute the command from the command line.\
This will help u know the difference if that command is running as a cron then where it stops (.... if that stops) as compared to runniug from the commsnd line.
try posting the O/P for an individual command as run from the command line.
Regards
Sujit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 09:02 PM
тАО01-13-2009 09:02 PM
Re: Cronjob not running even in log showed the activities
> 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
Something is running and got an return code of 9. Probably do to that su that Patrick mentioned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 10:57 PM
тАО01-13-2009 10:57 PM
Re: Cronjob not running even in log showed the activities
i had changed my cronjob for one task for the test
bahora1(express)$ crontab -l
#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 > /home/express/tmp2/BAPIN_APL.out
output from BAPIN_APL.out
Processing /home/express/EDI/BAPLIE/APL/IN/RECEIVAL/636942.EDI
/home/express/BIN/edi_load_post.sh BAPIN_APL /home/express/EDI/BAPLIE/APL/IN/RECEIVAL/636942.EDI
Processing /home/express/EDI/BAPLIE/APL/IN/RECEIVAL/n0028499.edi
/home/express/BIN/edi_load_post.sh BAPIN_APL /home/express/EDI/BAPLIE/APL/IN/RECEIVAL/n0028499.edi
From the file i can't find any error and seem like conjob is running.The only thing is the command not do anything to our application.To be more specific, we are using cronjob as a schedule job to grap edi file sended by our customer and extract all edi information to our application.
i do a test by manually run the command and it's work to our application
bahora1(express)$ /home/express/BIN/edi_load_post.sh BAPIN_APL /home/express/EDI/BAPLIE/APL/IN/RECEIVAL/636942.EDI
crosscheck cron.allow
# cat cron.allow
root
adm
uucp
express
oracle
"express" user is there.
It's quit weird the command from cronjob not effect ou application.Any idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 11:12 PM
тАО01-13-2009 11:12 PM
Re: Cronjob not running even in log showed the activities
The current working directory and the contents of the PATH environment variable.
Try adding the PATH environment variable to the script as the first command (open with vi, go to line 2 (line 1 should read something like #!/usr/bin/sh) and do:
:!set | grep PATH
Close the script.
If that doesn't help, doing a pwd command in the script also helps. But only when you don't redirect anymore to /dev/null. Or have the script itself log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 11:27 PM
тАО01-13-2009 11:27 PM
Re: Cronjob not running even in log showed the activities
/home/express/BIN/edi_load_post.sh
set -x <<--= Add this at the start of the script
This will allow us the know how the script runs and offcourse you need to redirect the output as you are doing
Also the script needs to be more interactive saying what exatly it does
Good Luck !