Scripts ran through a <a href="http://www.inmotionhosting.com/support/edu/cpanel/301-run-cron-job">cron job</a> do not go through Apache like the Scripts on the servers for the web do. Apache may see a bad character in the script failing it when its ran. We were able to create a test.sh with the same code in your blah.sh and it worked. We noticed when your script ran in your blah.sh file, the following errors occurred.
<br /><p style="margin-left:20px;">[Sun Mar 24 03:34:25 2013] [error] [client 126.96.36.199] sh: /home/******5/public_html/blah.sh: /bin/bash^M: bad interpreter: No such file or directory, referer: https://www.************.com/uploadalbum<br />
[Sun Mar 24 03:34:42 2013] [error] [client 188.8.131.52] /home/******5/public_html/blah.sh: line 2: \r: command not found, referer: https://www.************.com/uploadalbum</p>
For some reason, when your file is ran, the interpreter is finding a "/r" before your script and failing to run the command. If you haven't already, try creating the script through the file manager and type the code through the <a href="http://www.inmotionhosting.com/support/edu/cpanel/cpanel-file-manager/file-manager-code-editor">code editor</a>. If you are uploading the script through FTP, the file may be retaining characters in the file that causes the error. You should be able to run that bash command with no problem on shared.
Like this Question? Tweet