4
votes

I set up a cron job in Cpanel according to backup but received this email alert: /usr/local/cpanel/bin/jailshell: /home/mahsanwe/cron_backups.php: Permission denied

How to fix it?

2
What's the exact command executed by your cron job?! - Bogdan Stoica
command: /usr/local/bin/php /home/mahsanwe/cron_backups.php I also set the permission to 755 but doesnot work! - yasaman Hosseinzadeh
Be sure that the cron_backups.php has the right owner:group (cpaneluser:cpaneluser). Also you could delete the cron job from cPanel and try to re-create it again - Bogdan Stoica
Thanks for your answer - yasaman Hosseinzadeh
Thanks for your answer .my problem was solved,I should have check this line in the file: $skin = "paper_lantern"; // Set to cPanel skin you use (script will not work if it does not match). - yasaman Hosseinzadeh

2 Answers

4
votes

Please add the PHP command to be executed. It should be like this.

* * * * * /usr/local/bin/php /home/mahsanwe/cron_backups.php

You can also refer the below article for more understanding.

https://manage.accuwebhosting.com/knowledgebase/3043/How-to-set-the-cron-job-to-run-a-PHP-script-in-cPanel.html

2
votes

Change permission file to 755.