The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cron not running garric UNIX for Advanced & Expert Users 6 04-11-2008 08:32 AM
Cron not running .. please help beisaikong Shell Programming and Scripting 2 07-12-2007 07:05 AM
cron job is not running Suguna UNIX for Advanced & Expert Users 3 09-28-2006 09:11 AM
Cron Job Not Running nag_sundaram HP-UX 1 10-17-2005 10:38 AM
not running in cron ajnabi UNIX for Advanced & Expert Users 4 07-11-2003 02:35 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-03-2009
yabhi_22 yabhi_22 is offline
Registered User
  
 

Join Date: Oct 2008
Location: mumbai India
Posts: 10
Cron job not running

Hi All,

I am editing crontab using -e option to add a new job
Below is the line
30 * * * * scriptpath

This job is not executing every thirty minutes.
I have checked, cron daemon is running.
What did I miss? Can some one help?
I am using cron shell..ksh
  #2 (permalink)  
Old 07-03-2009
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,116
A good place to start.
  #3 (permalink)  
Old 07-03-2009
yabhi_22 yabhi_22 is offline
Registered User
  
 

Join Date: Oct 2008
Location: mumbai India
Posts: 10
Ok. For a cron job the required profile must be set so that the script executes.
Now how do we tell cron that it has to execute the script with this profile
  #4 (permalink)  
Old 07-04-2009
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,116
a variation of.......
Code:
30 * * * * . ~/.profile && scriptpath
  #5 (permalink)  
Old 07-04-2009
scottn scottn is online now Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 968
Quote:
Ok. For a cron job the required profile must be set so that the script executes.
Now how do we tell cron that it has to execute the script with this profile
Is not true.

Not loading the .profile does not "stop" a cronjob from executing. It may be that without it the job will not work, but that's not the same thing.

If your script produces output it will (normally) go to your mailbox if it's set up. Check your mail to see if there are any errors.

A common cause (apart from the daemon not running) of cronjobs not running is that too many jobs are running and new jobs are queued up and the daemon can't start them
Code:
/var/log/cron
or
/var/adm/log/cron
or
somewhere else depending on your OS
should report if this is the case.
  #6 (permalink)  
Old 07-04-2009
yabhi_22 yabhi_22 is offline
Registered User
  
 

Join Date: Oct 2008
Location: mumbai India
Posts: 10
I checked /var/log/cron there are no logs being generated. My script itself has its own log. Even its not being created. I am not sure what going wrong.How do I debug whether a cron job is executing or not?
  #7 (permalink)  
Old 07-04-2009
scottn scottn is online now Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 968
You never said if you were able to run the job manually.

Can you show the actual crontab entry?

can you also...

Code:
cd /where/my/script/is
ls -l script_name
ksh -n script_name
Thanks.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0