The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Local shell script need to be executed on a remote linux box rajeshomallur Linux 6 05-02-2008 10:05 AM
perl - why is the shell script executed before the print command? mjays Shell Programming and Scripting 3 09-21-2007 02:49 AM
Unix shell script couldn't be executed. Pls help! duke0001 Shell Programming and Scripting 8 09-14-2006 08:15 PM
Help - Need simple example of VI executed in shell script corsart AIX 2 06-03-2006 03:25 PM
bash scripting cannot executed in crontab jimmbp Shell Programming and Scripting 6 11-11-2005 08:23 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 06-09-2005
Registered User
 

Join Date: Apr 2005
Posts: 51
Shell script doesn't get executed using crontab

I have the following crontab entry to run a shell script for every 30 minutes of every day:

30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log

after I created the crontab file I have also done:
$crontab my_crontab

I also check to make sure it exists, by using the following command.
$crontab -l
I get the crontab entry- 30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log

But, why is the shell script not getting executed every minute?
Reply With Quote
Forum Sponsor
  #2  
Old 06-09-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,003
please read the rules:
(5) Search the forums database with your keywords before asking.
Reply With Quote
  #3  
Old 06-09-2005
Registered User
 

Join Date: Apr 2005
Posts: 51
I actually searched the forum and read the cron and crontab article. I did not find a resolution to this problem. Which is why I posted it.
Reply With Quote
  #4  
Old 06-09-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,003
Quote:
Originally Posted by radhika
I actually searched the forum and read the cron and crontab article. I did not find a resolution to this problem. Which is why I posted it.
in this case you've probably read about the enviroment settings as they pertained to cron?
Reply With Quote
  #5  
Old 06-09-2005
Registered User
 

Join Date: Apr 2005
Posts: 51
I didn't think the problem was in environment variables- because the following works:
45 13 * * 1-5 $HOME/main_ics.sh >> $HOME/main_ics.log 2>>$HOME/error.log

but not when I change the cron to:
30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log
Reply With Quote
  #6  
Old 06-09-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,003
Quote:
Originally Posted by radhika
I didn't think the problem was in environment variables- because the following works:
45 13 * * 1-5 $HOME/main_ics.sh >> $HOME/main_ics.log 2>>$HOME/error.log

but not when I change the cron to:
30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log
aren't they 2 different scripts?
Reply With Quote
  #7  
Old 06-09-2005
Registered User
 

Join Date: Apr 2005
Posts: 51
They are not I just changed the script name for posting and forgot to change on my reply.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0