Permission denied with bash.sh to run cron
you can try the following solution as well:
chmod +x post.php
chmod +x bash.sh
echo "* * * * * /home/samitha/bash.sh >> /home/samitha/log/cron.log 2>&1" >> cronjob
chmod +x cronjob
/etc/init.d/crond start #redhat based servers like centos
/etc/init.d/cron start #debian based servers like ubuntu
crontab cronjob
permission denied while running cronjob
I presume its your own personal user that you are using for this cron, which does not have permission to execute the file. Perhaps the file was created as root user or as some other user and therefore the credentials are not set to allow your user to execute.
First - Try to check what permissions are set on the file
ls -l /var/www/html/etl_project/ | grep run_etl_incomplete.sh
Check the output to see who is the owner and group and what permissions are set.
To make the file executable -
chmod +x /var/www/html/etl_project/run_etl_incomplete.sh
This will work only if you have the correct permissions in the first place (if your user is part of the group for example) to modify the file.
Once the file is made executable your cron will run.
How to solve permission denied error in cron?
you must give execute permission to your script before executing.
chmod u+x shellScript.sh
crontab permission denied error
You have to put the eXecutable bit on the script to do the job:
chmod +x /home/zenoss/zen-remote-bkup.sh
Related Topics
Are PHP Associative Arrays Ordered
How to Set 777 Permission on a Particular Folder
Can't Decrypt Using Pgcrypto from Aes-256-Cbc But Aes-128-Cbc Is Ok
How to Remove the Leading Character from a String
Laravel No Supported Encrypter Found. the Cipher And/Or Key Length Are Invalid
How to Populate HTML Dropdown List with Values from Database
Codeigniter Session Data Lost After Redirect
Sending Xml Data Using Http Post with PHP
Session Unset, or Session_Destroy
Replace Only First Match Using Preg_Replace
PHP Object Attribute with Dot in Name
How to Bind SQL Variables in PHP
Resetting MySQL Root Password with Xampp on Localhost
PHP Cli Getting Input from User and Then Dumping into Variable Possible
Create an Order Programmatically with Line Items in Woocommerce 3+