mih
May 24, 2025, 4:34pm
1
Hi all,
I’m having trouble with cron jobs for the user hestiaweb
on my HestiaCP server. Although the cron service is running fine and cron jobs for other users work as expected, the jobs under hestiaweb
do not trigger.
Here’s what I have checked so far:
The crontab file /var/spool/cron/crontabs/hestiaweb
exists with correct permissions (-rw-------
) owned by hestiaweb
.
Listing cron jobs with sudo crontab -u hestiaweb -l
shows the correct scheduled commands.
Running the cron scripts manually as hestiaweb
returns the following error:
/usr/local/hestia/func/main.sh: line 10: /usr/local/hestia/conf/hestia.conf: Permission denied
The file /usr/local/hestia/conf/hestia.conf
has permissions -rw-r--r-- root root
, so it should be readable by any user.
However, the parent directory /usr/local/hestia/conf
has permissions drwxr-x--- root root
, which blocks hestiaweb
from accessing it.
Because of this, the cron jobs running as hestiaweb
cannot read necessary config files and fail to execute properly.
Questions:
What is the best practice to fix this issue without compromising server security?
How should I configure permissions so that hestiaweb
can run its cron jobs successfully?
Is there a recommended way in HestiaCP to manage cron jobs for the hestiaweb
user?
Thanks in advance for any help!
Want me to help you with posting it or adding any logs?
Hi @mih
Show the output of these commands (as root):
cat /etc/sudoers.d/hestiaweb
ls -la /var/spool/cron/crontabs
crontab -l -u hestiaweb | cat -A
mih
May 24, 2025, 4:50pm
3
cat /etc/sudoers.d/hestiaweb
Defaults:root !requiretty
# sudo is limited to hestia scripts
hestiaweb ALL=NOPASSWD:/usr/local/hestia/bin/
ls -la /var/spool/cron/crontabs
total 44
drwx-wx--T 2 root crontab 4096 May 24 19:23 .
drwxr-xr-x 5 root root 4096 Feb 27 17:35 ..
-rw------- 1 admin admin 65 May 3 01:54 admin
-rw------- 1 user1 user1 75 Apr 3 13:33 user1
-rw------- 1 user2 user2 73 Dec 19 2023 user2
-rw------- 1 user3 user3 145 May 21 11:24 user3
-rw------- 1 user4 user4 10 Aug 1 2023 user4
-rw------- 1 hestiaweb crontab 832 May 24 19:36 hestiaweb
-rw------- 1 root root 1033 May 24 19:36 hestiaweb.vst.back
-rw------- 1 user5 user5 74 May 22 2024 user5
-rw------- 1 root crontab 1220 Apr 12 00:10 root
crontab -l -u hestiaweb | cat -A
MAILTO=""$
CONTENT_TYPE="text/plain; charset=utf-8"$
*/2 * * * * sudo /usr/local/hestia/bin/v-update-sys-queue restart$
10 00 * * * sudo /usr/local/hestia/bin/v-update-sys-queue daily$
15 02 * * * sudo /usr/local/hestia/bin/v-update-sys-queue disk$
10 00 * * * sudo /usr/local/hestia/bin/v-update-sys-queue traffic$
30 03 * * * sudo /usr/local/hestia/bin/v-update-sys-queue webstats$
*/5 * * * * sudo /usr/local/hestia/bin/v-update-sys-queue backup$
10 05 * * * sudo /usr/local/hestia/bin/v-backup-users$
20 00 * * * sudo /usr/local/hestia/bin/v-update-user-stats$
*/5 * * * * sudo /usr/local/hestia/bin/v-update-sys-rrd$
24 3 * * * sudo /usr/local/hestia/bin/v-update-letsencrypt-ssl$
Just to clarify. The cron jobs are added for user hestiaweb but they run as root (you will see that all commands use sudo).
Ok, remove this file:
rm -f /var/spool/cron/crontabs/hestiaweb.vst.back
Use this command to edit crontab and save (there is no need to modify anything, just edit and save):
crontab -e -u hestiaweb
Wait five minutes and check whether cron jobs run again:
grep 'CRON.*v-update' /var/log/syslog
mih
May 24, 2025, 5:18pm
5
crontab -e -u hestiaweb
MAILTO=""
CONTENT_TYPE="text/plain; charset=utf-8"
*/2 * * * * sudo /usr/local/hestia/bin/v-update-sys-queue restart
10 00 * * * sudo /usr/local/hestia/bin/v-update-sys-queue daily
15 02 * * * sudo /usr/local/hestia/bin/v-update-sys-queue disk
10 00 * * * sudo /usr/local/hestia/bin/v-update-sys-queue traffic
30 03 * * * sudo /usr/local/hestia/bin/v-update-sys-queue webstats
*/5 * * * * sudo /usr/local/hestia/bin/v-update-sys-queue backup
10 05 * * * sudo /usr/local/hestia/bin/v-backup-users
20 00 * * * sudo /usr/local/hestia/bin/v-update-user-stats
*/5 * * * * sudo /usr/local/hestia/bin/v-update-sys-rrd
24 3 * * * sudo /usr/local/hestia/bin/v-update-letsencrypt-ssl
grep ‘CRON.*v-update’ /var/log/syslog
2025-05-24T20:05:01.819119+03:00 panel CRON[922337]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-rrd)
2025-05-24T20:05:01.819893+03:00 panel CRON[922338]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue backup)
2025-05-24T20:06:01.271133+03:00 panel CRON[923317]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue restart)
2025-05-24T20:08:01.496517+03:00 panel CRON[923418]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue restart)
2025-05-24T20:10:01.722654+03:00 panel CRON[923872]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-rrd)
2025-05-24T20:10:01.723775+03:00 panel CRON[923874]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue backup)
2025-05-24T20:10:01.724257+03:00 panel CRON[923875]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue restart)
2025-05-24T20:12:01.918985+03:00 panel CRON[925338]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue restart)
2025-05-24T20:14:01.140566+03:00 panel CRON[925485]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue restart)
2025-05-24T20:15:01.268766+03:00 panel CRON[925619]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-rrd)
2025-05-24T20:15:01.269316+03:00 panel CRON[925620]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue backup)
2025-05-24T20:16:01.458324+03:00 panel CRON[926118]: (hestiaweb) CMD (sudo /usr/local/hestia/bin/v-update-sys-queue restart)
Perfect, it works again.
These merged PRs will fix this issue in next Hestia release:
main
← sahsanu:fix-panel_cronjobs-hestiaweb
opened 12:24AM - 06 Mar 25 UTC
https://forum.hestiacp.com/t/fresh-install-automatics-backups-arent-working/1834… 1
When editing hestiaweb cron jobs, Hestia leaves the file `/var/spool/cron/crontabs/hestiaweb.vst.back`, but it should remove it because cron is not applying the new configuration in file `hestiaweb`. Instead, it is using the backup file `hestiaweb.vst.bak`.
This PR fixes the issue by modifying `/usr/local/hestia/web/edit/server/hestiaweb/index.php` and `/usr/local/hestia/bin/v-change-sys-service-config`.
main
← sahsanu:newline-hestiaweb-crontab
opened 02:01AM - 20 May 25 UTC
This fix complements #4891
The hestiaweb user's crontab requires a newline c… haracter at the end of the file to be parsed correctly by crontab.
Fixes #4946
mih
May 24, 2025, 5:38pm
7
Hi @sahsanu ,
Thank you very much for your time, help, and clear explanations. I really appreciate your support and the way you guided me through solving the issue with the cron jobs for hestiaweb
. Everything is working correctly now!
Your assistance made a big difference — thanks again!
Best regards,
mih
1 Like