After updating Hestia all Cron scripts that work with files (for example php unlink or scandir and bash File) stopped working. Return error Permission denied. However the call from the console works correctly
Show the cron jobs for the user that is having issues:
v-list-cron-jobs YourUser
In addition, show an example of how you run that command from console and with which user.
All cron jobs are run from admin user.
From the console commands are run under root.
Maybe I need to somehow tell cron to run scripts from root user?
To be honest, I’m not very good at servers and consoles…
If you don’t know how to execute the command I posted above, show the list of cron jobs from Hestia Web UI.
Oh sorry. We have a lot of tasks in the Cron, but we are currently interested in one specific one:
root@lgs-sys:~# v-list-cron-jobs admin
JOB MIN HOUR MONTH WDAY COMMAND
--- --- ---- ----- ---- -------
107 39 * * * /bin/bash /backup/yandex.sh
Seems user admin doesn’t have the right perms to tun /backup/yandex.sh
script or to something that is trying to do the script.
Run this as root and you’ll see if the script can run using admin user:
sudo -u admin /bin/bash /backup/yandex.sh
Yes sudo -u admin /bin/bash /backup/yandex.sh
from console return Permission denied error
Then user admin doesn’t have the perms to execute the script and maybe it won’t have the right perms to do whatever the script does.
If the script must run as root, add the cron job directly to root and remove it from admin user.
Sorry, i can add cron job to root from Hestia Web UI?
No, you can’t.
You should add it from console using crontab -e
as root and adding manually the cron job/s.
Thank you very much, its worked!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.