cronjob not executing...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers cronjob not executing...
# 1  
Old 04-07-2009
cronjob not executing...

Hi All.

I created a cronjob entry and for some reason it is not executing. The script that it is suppose to call sends me an email when it is done. When I run the job manually it executes fine. This how my cron entry looks:

00 14 * * * /home/oracle/scripts/bin/free_space/free_space.sh 2>$1

So it should run everyday at 2pm, correct?

Don't know why it is not running.

Thanks.
# 2  
Old 04-07-2009
as always, check out the FAQ section and in particular crontab FAQ
# 3  
Old 04-08-2009
Thanks for pointing me to that. Unfortunately, I didn't find a solution to my problem. The other crons on my system work fine but this one doesn't...and they are both setup the same way.
# 4  
Old 04-09-2009
Quote:
00 14 * * * /home/oracle/scripts/bin/free_space/free_space.sh 2>$1
Contains a syntax error because of the "$1". Cron should have mailed the error message to the owner of the cron.

Did you actually mean to combine STDOUT and STDERR ?:

Code:
00 14 * * * /home/oracle/scripts/bin/free_space/free_space.sh 2>&1

# 5  
Old 04-09-2009
OMG, that was just dumb of me. Can't believe I did that.

Ok, well I changed it to the following like you said:

34 9 * * * /home/oracle/scripts/bin/free_space/free_space.sh 2>&1

And when I tried to run it again, it still didn't run. I checked my mail and this is all I see for this job:

U 18 root@humboldt.fprc.o Thu Apr 9 09:34 24/1098 "Cron <oracle@humboldt> /home/oracle/scripts/bin/free_space/free_space.sh 2>&1"

Not sure what that means.

Thanks.
# 6  
Old 04-09-2009
Ok, I got it to work.

I think it was trying to run it as root and it was failing when it tried to run sqlplus. So put some environment variables in the script and then it ran perfectly.

Thank you all for your help.Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Cronjob

How to set cronjob for 48 hours. I can set for 2 days as shown below. * * */2 * * It is creating confusion for 30 days & 31 days per month. (3 Replies)
Discussion started by: Nishit
3 Replies

2. UNIX for Dummies Questions & Answers

cronjob

Is the cronjob below can run only first wednesday of every month? 30 5 1-7 * 3 command please tell me (3 Replies)
Discussion started by: Anjan1
3 Replies

3. Shell Programming and Scripting

Executing oracle procedure using cronjob

Hi, Below is the code to execute the procedure "dbms_job.broken" from the shell script. on executing manually, it works properly without any error. but it is not working when scheduled using the cronjob. #!/usr/bin/bash user_name="oracdb" password="ora123" tns="localdb"... (2 Replies)
Discussion started by: milink
2 Replies

4. UNIX for Dummies Questions & Answers

Cronjob help

Hi I am very new to linux. I want to run a cronjob every 15 minutes that checks a directory for files. If the directory contains more than ten files I want it to send an email to me. All I have is this... */15 * * * * ls -l | wc -l | | mail -s "This is just a test" I would... (2 Replies)
Discussion started by: LinuxNewb
2 Replies

5. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

6. AIX

cronjob

Hi, I want to schedule a script on daily basis in morning 8:00 A.M and 5:00 P.M , how can i achieve this, i want the parameter 0 ? * * * what will be the second parameter in my case. Regards (1 Reply)
Discussion started by: maooah
1 Replies

7. Shell Programming and Scripting

Cronjob

Hi, I'm totally new to shell scripting. I need help in my crontab script. I'm trying to read some values from user (username, log file directory, server) and then use those value to create a crontab for log rotation after some interval of time. creating crontabs manually isn't big deal.... (11 Replies)
Discussion started by: MisterKhan
11 Replies

8. Solaris

at vs cronjob

HI, What is the differnece between at / con job? thanks in advance. (1 Reply)
Discussion started by: mokkan
1 Replies

9. UNIX for Dummies Questions & Answers

cronjob

hi iam new at unix.iam running a cronjob,which i want to run on the first day of every month at 1AM.this is what i have specified: 00 01 1 * * is this corect? (1 Reply)
Discussion started by: wiz83
1 Replies

10. HP-UX

CronJob

Dear Guru, I have submitted some cronjobs that has been running for quite sometimes. However, today I counter some cronjob did not run. Can you please explain what causes this to happen. Any system setting that limit number of cronjob per minutes to be started, etc? Thanks. Kelly (1 Reply)
Discussion started by: hcng08
1 Replies
Login or Register to Ask a Question