I've created a cronjob in ISPC for a website to run a bash script but it's not running. Can't find anything in the logs. Not even an attempt to run the cronjob. I've got webmin installed and can see the job is created by ISPC. The schedule seems to be as I configured in ISPC and within webmin I can run the cronjob without any problems. This is a recurring issue on multiple systems, all running Ubuntu 24.04. And no jailkit active. ISPC server and other system cronjob are running just fine.
If the cronjob file has been written correctly by ISPConfig, it can only be an issue in the cron daemon. Did you try to restart it or kill it and start it again?
What I tend to do as a test is to replace the command that shall be run with e.g.: touch /tmp/test.txt and then check at the scheduled time if the file /tmp/test.txt has been created or not. if its there, then the cron is running and the issue is in the script you run as cron.
The magic was in the paths. Your test example give me the direction to look into. It's working now on the system I created this topic for. Unfortunately that didn't solve it for a php script in the web folder (Nextcloud's cron.php) I'm trying to run on another system. I already had a workaround in place (manually created job executed by root with sudo -u webX added in the command) for that issue, though it would be nicer to schedule that from within ISPC too.
And which issue do you have for that script? Which exact command do you use in cron and is it a jailed or unjailed cronjob?
After your earlier post I've changed the command to: Code: /usr/bin/php --define apc.enable_cli=1 -f /web/cron.php But still nothing. It's not jailed. A manually created cronjob (the workaround) that is executed as root runs just fine with this command: Code: sudo -u webX /usr/bin/php --define apc.enable_cli=1 -f /var/www/clients/clientX/webX/web/cron.php
The path is wrong for a unjailed cronjob. The path you use dis for a jailed cronjob only. For a unjailed cronjob, the command would be: /usr/bin/php --define apc.enable_cli=1 -f /var/www/clients/clientX/webX/web/cron.php
If a cronjob is jailed, then /var/www/clients/clientX/webX/ becomes /, so the path is /web/cron.php. if its not jailed, then its that same paths as you would see it e.g. as root user on the system, which is /var/www/clients/clientX/webX/web/cron.php
The cronjob that is now running fine had at first this non working command: Code: bash /var/www/clients/clientX/webX/private/script.sh It's now working based on your touch example after which I changed it to: Code: bash /private/script.sh I think it got jailed because of a ssh/sftp user. Or am I talking nonsense now? The other job just won't work, not with full path and not with jailed path. (that site too has a ssh/sftp user)
First, always use full path in cronjobs. So ist /bin/bash and not just bash, as there is no PATH variable in Con on Linux, so cron can not find binaries if you leave out the path. Also, you do not have to prepend /bin/bash for a normal shell script, unless you missed to specify the shell in the first line of the script. If a cronjob is jailed or not can be seen in the cron file. If the shell of the cron files is a jailkit shell, then its jailed. If the shell is /bin/bash or /bin/sh, ist not jailed.