Hmmm, I tried to set a cron from ISPC but it does not seem to be run. Here are the settings: The content of the shell script is this: Code: root@manager /var/www/clients/client1/web9/web/urteile # cat /var/www/clients/client1/web9/web/urteile/cron.sh #!/bin/bash curPath="/var/www/clients/client1/web9/web/urteile"; php -f ${curPath}/bger_inital.php php -f ${curPath}/bverwg_inital.php php -f ${curPath}/bstger_inital.php php -f ${curPath}/sg_inital.php php -f ${curPath}/fr_inital.php php -f ${curPath}/email.php php -f ${curPath}/email_bverwger.php php -f ${curPath}/email_bstger.php php -f ${curPath}/email_sg.php php -f ${curPath}/email_fr.php Running the shell script from the terminal works fine but cron doesn't run it.
If this is a jailed cronjob, then the ath to the script is /web/urteile/cron.sh and in the jail, php cli is most likely not available. By the way, doing this as url cron would be much easier, url cron means that you run a httprequest by entering just the url in the cron command field: http://www.yourdomain.tld/web/urteile/cron.php and in the cron.php you add the other php files as includes or as url fopen.
I try now using full path to the php binary. There's no cron.php but a bash script "cron.sh". it should be working from the command line. When running it in the shell it should work. I plan on moving those files outside the web dir anyway.
I altered the cron.sh file to this: Code: #!/bin/bash main_function { curPath="/var/www/clients/client1/web9/web/urteile"; /usr/bin/php -f ${curPath}/bger_inital.php /usr/bin/php -f ${curPath}/bverwg_inital.php /usr/bin/php -f ${curPath}/bstger_inital.php /usr/bin/php -f ${curPath}/sg_inital.php /usr/bin/php -f ${curPath}/fr_inital.php /usr/bin/php -f ${curPath}/email.php /usr/bin/php -f ${curPath}/email_bverwger.php /usr/bin/php -f ${curPath}/email_bstger.php /usr/bin/php -f ${curPath}/email_sg.php /usr/bin/php -f /var/www/web1/html/urteile/email_fr.php } if [ -z $TERM ] then # if not run via terminal, log everything into a log file main_function 2>&1 >> /var/www/clients/client1/web9/web/urteile/cron.log else # run via terminal, only output to screen main_function fi That should make a cron.log file when the script is called by cron. However, the script should have been called meanwhile but no .log file was created. So, cron doesn't run that script.
Please see my comments on paths in #3.If this is a jailed cronjob, then none of the paths (neither curPath nor the log path) exist from the view of the cronjob as the root of the jail is /var/www/clients/client1/web9/, so you have to use paths the are relative to that dir inside the script like: /web/urteile/cron.log instead of: /var/www/clients/client1/web9/web/urteile/cron.log You can see if the cronjob is jailed or not in the cron file in /etc/cron.d/ Beside that. there is no php binary available in the jail, so you cant call php then (see #3).
Change the shell in the cronjob config file in /etc/cron.d/ to /bin/bash and ensure that you allow unjailed cronjobs for this client and change the cron type to unjailed cron in the cronjob settings.
actually I did now cancel the "jail" line. but my question was rather aimed at how to permanently disable the jailing of crons. (At the same time I'd also like to know how to enable the shell for the websites by default)
Thats what I explained you above in #8: .... and ensure that you allow unjailed cronjobs for this client and change the cron type to unjailed cron in the cronjob settings. PLease be aware that unjailed cronjobs can be a real security problem if you allow clients access to them. I explained you in #3 how to implement your cronjob in a secure way as html cronjon´b as a .sh file is not required when you use it just to call a few php files.