- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: cron job not running
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-15-2009 02:46 AM
тАО01-15-2009 02:46 AM
cron job not running
0,15,30,45 * * * * /var/spool/cron/form_session_1
Other cron jobs defined in crontab are running perfectly. Is there any mistake in the format of the cron job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 02:52 AM
тАО01-15-2009 02:52 AM
Re: cron job not running
0,15,30,45 * * * * /sbin/sh /var/spool/cron/form_session_1
if its not working then post the output of,
#echo $SHELL
and the full error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 03:02 AM
тАО01-15-2009 03:02 AM
Re: cron job not running
-rwxrwxrwx 1 root sys 405 Jan 15 10:42 form_session_1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 03:06 AM
тАО01-15-2009 03:06 AM
Re: cron job not running
can u post he
#echo $SHELL
and the full error, which u are getting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 03:10 AM
тАО01-15-2009 03:10 AM
Re: cron job not running
/sbin/sh
I am not getting any error. It is not running at all. I don't see any reference in /var/mail/root file of its running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 03:15 AM
тАО01-15-2009 03:15 AM
Re: cron job not running
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 03:19 AM
тАО01-15-2009 03:19 AM
Re: cron job not running
the /var/adm/cron/log file and look for your script, if you see its executing ok, then check
your variables.
you have to remember that cron executes the scripts with:
warning: commands will be executed using /usr/bin/sh
check the scripts has all the variables it needs includind the PATH and others..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 03:23 AM
тАО01-15-2009 03:23 AM
Re: cron job not running
You should always use the "crontab -e" command to edit crontabs. After the editing is complete, the "crontab -e" command will signal the cron process to indicate that the cron job files have been edited. If you edit /var/spool/cron/crontabs/root directly, this does not happen and cron will ignore your changes until you restart the cron daemon (/sbin/init.d/cron stop; /sbin/init.d/cron start) or reboot the system.
(If you don't like the "vi" editor, set the EDITOR environment variable to indicate your favorite editor. Then the "crontab" command will use your favorite editor too.)
Also check the logfile of the cron daemon: /var/adm/cron/log.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 05:36 AM
тАО01-15-2009 05:36 AM
Re: cron job not running
as u have said that the other cron jobs are running , that means that the cron subsystem is working OK on the server.
Also that the syntax entry that u have made in the crontab file is OK as far as the syntax goes.
i assume that u are running this script as root.
check that this script runs perfectly as u try to run the saem from the command line.
if yes try to add to the command as u put the same in the crontab (use crontab -e to edit the cron file) to redirect the O/P to some file say /tmp/sript.out
as
0,15,30,45 * * * * /var/spool/cron/form_session_1 >> /tmp/sript.out
try running this as a cron and see the O/P of the file /tmp/sript.out
try comparing this O/P with that when u run this job directlyy from the command line.
u shall be able to differentiate.
Also the log of the tasks that are executed using cron is present in
/var/adm/cron/log
if u are using /var/adm/cron.allow and /var/adm/cron.deny then make sure that the user with whom the cron job shall be running is listed in the /var/adm/cron/cron.aloow file.
make sure that the first line in the script has
#!/usr/bin/ksh
Regards
Sujit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2009 11:39 AM
тАО01-15-2009 11:39 AM
Re: cron job not running
The better way to troubleshoot this is to edit /var/spool/cron/form_session_1 and at the start of the script add "set -x"
set -x
After this in the crontab redirect the output to a file for which Sujit has posted the syntax
After this keep checking
# tail -f /var/adm/cron/log
Check if it fails with rc=*
Also check the file which you have redirect the output to..
This really provide a vital information
May be cron is running the script, but the script might be failing due to variable or permission issue if the script is writing to some file