Cron job not triggering.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cron job not triggering.
# 1  
Old 10-25-2012
Cron job not triggering.

Hi,

I have scheduled a job using cron but the job is not getting triggred because of the following error.

Code:
line 5: /env/env_setup.sh: No such file or directory

But the file env_setup.sh is there in that location.

Code:
/scripts/env
 
-rwxrwxrwx 1 mysql mysql 974 Oct 24 10:41 env_setup.sh

But the job is running fine when i am triggering it manually,not using cron.

please suggest

Last edited by Scott; 10-25-2012 at 07:12 AM.. Reason: Code tags
# 2  
Old 10-25-2012
what is output of

Code:
crontab -l

You have to give complete path of the script in crontabSmilie
# 3  
Old 10-25-2012
in the cron i have mentioned the complete path

Code:
30 5 * * * /home/scripts/jobs/backup.sh 2>err_bkp.txt |mailx -s "success" abc.cde@xyz.com <err_bkp.txt

Actually the script env_setup.sh is getting called inside this script backup.sh

Code:
#Executing the environment script.
. $MYSQL_SCRIPTS_HOME/env/env_setup.sh $0 "scripts"
 
echo $MYSQL_SCRIPTS_HOME
 
/home/scripts

Smilie

Last edited by Scott; 10-25-2012 at 07:12 AM.. Reason: Code tags
# 4  
Old 10-25-2012
You may try using sh

Code:
sh $MYSQL_SCRIPTS_HOME/env/env_setup.sh $0 "scripts"

OR

Code:
$MYSQL_SCRIPTS_HOME/env/env_setup.sh $0 "scripts"

# 5  
Old 10-25-2012
Code:
sh: /env/env_setup.sh: No such file or directory

still the same error

Moderator's Comments:
Mod Comment Just so you know, this is the 35th time a moderator has had to edit one of your posts to add code tags, or for another reason. It will be the last.
# 6  
Old 10-25-2012
Obviously your $MYSQL_SCRIPTS_HOME variable is unset or empty, having your sh script search in the root dir: /env/env_setup.sh. Try running your .profile (or similar) in the cron script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

3. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

4. Solaris

Scheduling job not triggering

I am scheduling job using Datastage tool, which tool is installed on solaris server. I can able to schedule jobs/sequences, its not trigering at specified scheduling trigerring time. but at specified job not starting automatically. Till that specified schedule time, i can able to see that the job... (6 Replies)
Discussion started by: sridhardwh
6 Replies

5. UNIX for Dummies Questions & Answers

Cron is running,but my job is not triggering.

Hi, I have scheduled a job previously and was running fine,but due to some issue i have commented it.Now the issue was solved and i have scheduled as below in crontab. 30 2 * * * /u01/srcdata/CSA/holding/common/script/QPLR_RegValrao.sh PROD Cron is running,but my job is not triggering. ... (1 Reply)
Discussion started by: mvennakula
1 Replies

6. Shell Programming and Scripting

cron job

hi, i have set a cron job to run build in one of the env. it shud basically stop the server,deploy the code and start the server. while starting the server the logs are getting created with the cron account id and not the normal user because of which the server is not coming up. can you please... (4 Replies)
Discussion started by: suryans
4 Replies

7. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

8. Solaris

cron job

hi, how i woulsd be able to find that my cron job is running or not.. E.g abc (2 Replies)
Discussion started by: sam.whocares
2 Replies

9. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

10. UNIX for Dummies Questions & Answers

Cron Job

Hi I want to execute a script on the last day of every month. I tried using the following line but it failed: 50 23 * * * && cd live/cgi-bin/;perl org_stats_monthly_cron_job.cgi log shows: CMD: Its a Solaris box. Could someone please help me out? Thanks in advance. (3 Replies)
Discussion started by: tom123
3 Replies
Login or Register to Ask a Question