Cron job not triggering.

Hi,

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

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

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

/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

what is output of

crontab -l

You have to give complete path of the script in crontab:)

in the cron i have mentioned the complete path

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

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

:confused:

You may try using sh

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

OR

$MYSQL_SCRIPTS_HOME/env/env_setup.sh $0 "scripts"
sh: /env/env_setup.sh: No such file or directory

still the same error

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.