Shell script doesn't get executed using crontab


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script doesn't get executed using crontab
# 1  
Old 06-09-2005
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?
# 2  
Old 06-09-2005
please read the rules:
(5) Search the forums database with your keywords before asking.
# 3  
Old 06-09-2005
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.
# 4  
Old 06-09-2005
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?
# 5  
Old 06-09-2005
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
# 6  
Old 06-09-2005
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?
# 7  
Old 06-09-2005
They are not I just changed the script name for posting and forgot to change on my reply.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script containing Curl doesn't run with crontab

Hello I have a problem with the crontab command when I run a code containing Curl on the command line it runs without fail but as soon as I program it with crontab it executes everything except the curl returns fail thank you for helping me to resolve this problem because since Monday I look... (14 Replies)
Discussion started by: beautymind
14 Replies

2. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies

3. Shell Programming and Scripting

Multiple shell scripts executed in one script

Hi every one, i am new to shell script. my people given a task to write a shell script that should execute number of shell scripts in that. in that, if any shell script is failed to execute, we have to run the main script again, but the script should start execute from the failed script only.. it... (1 Reply)
Discussion started by: Madhu Siddula
1 Replies

4. Shell Programming and Scripting

Shell script not getting executed

Hi As per my requirement when I run . ./file.sh am getting the following error -bash:ELF: command not found when i execute as ./file.sh it is getting executed.How to resolve this. Thanks in advance. (3 Replies)
Discussion started by: pracheth
3 Replies

5. Shell Programming and Scripting

Shell script executed from Informatica ETL tool is spawning 2 processes for one script

Hi, I am having a shell script which has a while loop as shown below. while do sleep 60 done I am executing this script from Informatica ETL tool command task from where we can execute UNIX commands/scripts. When i do that, i am seeing 2 processes getting started for one script... (2 Replies)
Discussion started by: chekusi
2 Replies

6. Shell Programming and Scripting

help with shell script executed by php.

I made a shell script to execute a server in screen mode. # start server screen -d -m -S Test ./application echo "Program Started Successfully" than I'm executing it from php by echo shell_exec('/home/script.sh'); and it is giving me this error. "cannot make directory... (1 Reply)
Discussion started by: dmallia
1 Replies

7. Shell Programming and Scripting

korn shell script executed with error

Hi, need help, I would like to know what is this IF statement trying to do? When the script is executing and error out with line 9 which is the IF statement line. if ] then TOPDIR=$(pwd) else TOPDIR=${0%/*} fi TOPDIR=${TOPDIR%/*} the log file. Current system time is... (15 Replies)
Discussion started by: beooi
15 Replies

8. Shell Programming and Scripting

Expect script doesn't work under crontab

Hi All, Using Expect script when I run it manually it works. But when I put the entry in crontab, the job is still running after 15 hours. The script was created as root. I don't think it's a permission issue. Any idea? This is what I have under root crontab... 00 18 * * 1-5... (4 Replies)
Discussion started by: samnyc
4 Replies

9. Shell Programming and Scripting

Routine doesn't give output when executed in crontab

I have a script running in the crontab that gets data from a database every hour. Now I would like to execute a fortran routine to process the data in some way, after getting it and saving it locally. I have added the following commands to my script: set convert =... (1 Reply)
Discussion started by: SharkM
1 Replies

10. AIX

Help - Need simple example of VI executed in shell script

Please help - I have seen others ask this question but I need a simple example of using vi in a shell script. Once I enter VI the shell script does not execute the next commands until I q!. I invoke VI and start the edit process. I want to go to the third line and replace a character with a new... (2 Replies)
Discussion started by: corsart
2 Replies
Login or Register to Ask a Question