facebook twitter youtube
Replication Query Optimization DB Tuning Server Load and Query Locking Linux Download Interview Questions Basic DB Commands Mysql
in Linux Related Issues - 18 Sep, 2013
by Zafar Malik - no comments
Script is not executing through cron even executing manually (error:Permission denied)

Script is not executing through cron even executing manually (error:Permission denied):

 

Problem: I created a new script (myscript.sh) and scheduled through cron but this script was not executing even it was executing successfully when I was executing manually.

Possible Reasons:

1. User Rights Issue: As this script was executing from root login same like as other scripts, those were executing successfully. So it does not seems user rights issue.

2. As script was executing successfully manually, so does not seems any wrong syntax issue in script.

Actual Reason: After trouble shooting and monitoring cron error logs, it came to know that I forgot to give executable permissions to this script (myscript.sh).

Solutions: Execute below command-

chmod +x /root/scripts/myscript,sh

Now script is executing successfully from crontab.

Leave a Reply