- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- cron failing to execute
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
Forums
Discussions
Discussions
Discussions
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
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
12-05-2004 05:46 PM
12-05-2004 05:46 PM
cron failing to execute
we have RH 8.0 running clearcase server. I have written some scripts and when I scheduled it using cron (entry has been made in /etc/cron.daily),job is not at all getting executed. any body can help me.
(crond is running)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 05:55 PM
12-05-2004 05:55 PM
Re: cron failing to execute
Try to execute the script with debug mode and check that you are using exit 0 at end.
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 06:07 PM
12-05-2004 06:07 PM
Re: cron failing to execute
The files of which are placed in this directory have to be able to be executed on their own (i.e. must have #!/bin/shell or are binaries, and must be 'chmod +x'd).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 06:17 PM
12-05-2004 06:17 PM
Re: cron failing to execute
Hi,
The log file shows this,
Dec 6 11:01:00 zambezi CROND[2779]: (root) CMD (root run-parts /etc/cron.hourly)
Dec 6 11:47:00 zambezi crond[805]: (*system*) RELOAD (/etc/crontab)
Dec 6 11:47:00 zambezi crond[805]: (tmp.28731) ORPHAN (no passwd entry)
Dec 6 11:47:00 zambezi CROND[3091]: (root) CMD (run-parts /etc/cron.daily)
Dec 6 11:47:02 zambezi anacron[3260]: Updated timestamp for job `cron.daily' to 2004-12-06
I am modifying cron.daily time to suit my requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 07:26 PM
12-05-2004 07:26 PM
Re: cron failing to execute
Do a simple 'ls -l' of '/etc/cron.daily/'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 07:29 PM
12-05-2004 07:29 PM
Re: cron failing to execute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 07:37 PM
12-05-2004 07:37 PM
Re: cron failing to execute
these are the files under cron.daily
]$ ll
total 32
lrwxrwxrwx 1 root root 28 Dec 17 2003 00-logwatch -> ../log.d/scripts/logwatch.pl
-rwxr-xr-x 1 root root 135 Jul 2 2002 00webalizer
-rwxr-xr-x 1 root root 276 Aug 28 2002 0anacron
-rwxr-xr-x 1 root root 496 Dec 6 11:54 b4bkup
-rwxr-xr-x 1 root root 51 Jun 24 2002 logrotate
-rwxr-xr-x 1 root root 418 Sep 3 2002 makewhatis.cron
-rwxr-xr-x 1 root root 104 Sep 4 2002 rpm
-rwxr-xr-x 1 root root 137 Apr 23 2004 slocate.cron
-rwxr-xr-x 1 root root 193 Jun 24 2002 tmpwatch
Root is not receiving any mails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 07:42 PM
12-05-2004 07:42 PM
Re: cron failing to execute
i prefer execute some scripts with "crontab -e", and determine execute time yourself
good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 08:01 PM
12-05-2004 08:01 PM
Re: cron failing to execute
Can you give output for "ls -l" on linked file ../log.d/scripts/logwatch.pl ?
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 08:05 PM
12-05-2004 08:05 PM
Re: cron failing to execute
Probbaly script runs but just doesn't do what you want?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 09:54 PM
12-05-2004 09:54 PM
Re: cron failing to execute
are the other daily scripts running ?
I suggest that you put a mail command sendind to you a message when your script starts, as a debug actions like Vitaly Karazik said.
I assume that you have tested your script running it for yourself (not using cron), and that it is doing it's job.
Regards,
Xyko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 11:41 PM
12-05-2004 11:41 PM
Re: cron failing to execute
I am new to Linux world, worked extensively on HP-UX and AIX. The script used to work on AIX ( scheduled it using cron)but the same script on Linux is not working. Even the simple 'echo' is not working when i scheduled it using crontab. I don't know whether existing scheduled jobs are executing or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 11:57 PM
12-05-2004 11:57 PM
Re: cron failing to execute
try to specify the shell used to run the script. Normaly you don't have to do so on HP-UX nor AIX.
Put a first line in your script like that and try again.
#!/bin/bash
Regards,
Xyko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2004 11:59 PM
12-05-2004 11:59 PM
Re: cron failing to execute
I have specified the shell and everything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 12:04 AM
12-06-2004 12:04 AM
Re: cron failing to execute
Sorry Xyko, but bash shouldn't be used. Try to use /bin/sh instead. It is linked to bash, but, executed through this link, it will act as a posix SH. This will probably be better.
Could you post your shell script here and errors at runtime ? It would help resolving problems.
Another point (when shell will work) is that cron is not setting environment. So you will have to put in cron a wrapper to this shell, first placing env then call your script. Other way is to use "su - user -c job" (even for root) to set env.
Note that preceding post is right. It is more common to use crontab than those system jobs to schedule jobs.
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 12:11 AM
12-06-2004 12:11 AM
Re: cron failing to execute
thank's for your comment.
Living and learning with friends.... that's the best part of our job.
regards,
Xyko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 12:16 AM
12-06-2004 12:16 AM
Re: cron failing to execute
if root doesn't receive email with error message from cron - cron job finished without errors.
I've checked cron right now by adding my script
to /etc/cron.daily directory and it works!
My script is:
echo "test" >/tmp/kkk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 12:34 AM
12-06-2004 12:34 AM
Re: cron failing to execute
Sorry if I'm a bit rude in my posts. I need to progress in english ;-)
Vitaly,
Wait for Ravi to post his script. Apparently it does not work on command line. Echo is working in cron as long as it is implemented in shell. Default PATH for cron jobs is null. "When a crontab command is run, this crontab runs it with /bin/sh and sets up only three environment variables: USER, HOME, and SHELL" (man crontab).
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 12:47 AM
12-06-2004 12:47 AM
Re: cron failing to execute
A small corection - all scripts under /etc/cron.* dirs have /sbin:/bin:/usr/bin:usr/sbin in PATH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 12:59 AM
12-06-2004 12:59 AM
Re: cron failing to execute
here is my script, which will lock all VOB's in the clearcase and stops it, and I have scheduled Veritas to backup all the VOB's.
#!/bin/sh
cleartool lock vob:/vob/adminvob
cleartool lock vob:/vob/testing
cleartool lock vob:/vob/testvob
cleartool lock vob:/vob/rambo
cleartool lock vob:/vob/Fcat
/opt/rational/clearcase/etc/clearcase stop
echo " Clearcase case ready to backup"
pls post your opinions, i will get back to you tomorrow as my wife already calling me home
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 01:03 AM
12-06-2004 01:03 AM
Re: cron failing to execute
instead of just "cleartool"
BTW, root *should* receive email with error message in your case. Do you have some mail alias for "root"? if no, there is some problem with email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 01:20 AM
12-06-2004 01:20 AM
Re: cron failing to execute
Echo command is exactly the kind of output that should be send by mail as long as there is no redirection.
Vitaly,
Is there any other particularity for those particular crons ? Where to have info on them (man page ?)
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 01:41 AM
12-06-2004 01:41 AM
Re: cron failing to execute
If the script works at the command line and not cron that is almost always the cause.
PATH is most important, but any environment variable wrong can cause the script to silently die in cron.
There is adequate diagnostic help in this thread to resolve the issue. I'd like to see error output.
Good Luck,
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 01:45 AM
12-06-2004 01:45 AM
Re: cron failing to execute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2004 03:26 AM
12-06-2004 03:26 AM
Re: cron failing to execute
you were not rude, don't be afraid of that.
Btw, my english is not good also.
Ravi, to look for root messages is a very good idea. Your mail system is probably misconfigured.
regards for everybody,
xyko