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.
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.