Cron for one site not running

Discussion in 'Server Operation' started by Dennis_sp, Nov 19, 2021.

  1. Dennis_sp

    Dennis_sp Member

    I have a site for which the cronjobs are not running.

    For the client connected to the site i have under client settings>Limits>Cron job limits:
    Max. number of cron jobs=0
    Max. Allowed Cronjob types (chrooted and full implies url)=Full Cron
    Min. delay between executions=0

    The job is set to run every minute and this is the command:

    /usr/bin/php7.2 -q /var/www/clients/client10/web59/web/crons/cron.php >/dev/null 2>&1

    When i run this command from the command line it runs just fine! No errors.

    I have another website for another client with the same type of webste and this cron runs just fine:
    /usr/bin/php7.2 -q /var/www/clients/client1/web54/web/crons/cron.php >/dev/null 2>&1

    I checked /var/log/ispconfig/cron.log but it shows no related errors.

    What can i do next?
     
  2. florian030

    florian030 Well-Known Member HowtoForge Supporter

    do you set the cron-type-limit for both to the same value? did you add the cron-jobs as admin and the client never edited / save the cron-jpb?
     
  3. Dennis_sp

    Dennis_sp Member

    Yes both sites have the same limit values and i always login with the same admin account and the client is myself in this case.
     
  4. florian030

    florian030 Well-Known Member HowtoForge Supporter

    compare the two files in /etc/cron.d
     
  5. Dennis_sp

    Dennis_sp Member

    These are the files i see, so it looks like web59 was chrooted, should i simply delete the job and re-create it from the GUI?

    -rw-r--r-- 1 root root 281 Jul 25 2016 amavisd-new
    -rw-r--r-- 1 root root 257 Jun 1 2018 awstats
    -rw-r--r-- 1 root root 485 Oct 3 2019 certbot
    -rw-r--r-- 1 root root 514 Jun 22 20:47 ispc_chrooted_web59
    -rw-r--r-- 1 root root 276 Dec 5 2020 ispc_web51
    -rw-r--r-- 1 root root 270 Dec 5 2020 ispc_web54
    -rw-r--r-- 1 root root 1566 Sep 13 2016 mailman
    -rw-r--r-- 1 root root 589 May 12 2017 mdadm
    -rw-r--r-- 1 root root 712 Aug 8 2017 php
    -rw-r--r-- 1 root root 102 Aug 21 2017 .placeholder
    -rw-r--r-- 1 root root 190 Jun 1 2018 popularity-contest
    -rw-r--r-- 1 root root 253 Aug 22 2017 roundcube-core
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Did you compare contents of the files?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    That's probably the fastest solution, yes.
     
  8. Dennis_sp

    Dennis_sp Member

    web54 (working):

    Code:
    MAILTO=''
    SHELL='/bin/sh'
    
    */5     *       *       *       *       web54   /usr/bin/php7.2 -q /var/www/clients/client1/web54/web/crons/cron.php  >/dev/null 2>&1 
    *       *       *       *       *       web54   /usr/bin/php7.2 -q /var/www/clients/client1/web54/web/crons/pop.php  >/dev/null 2>&1  


    web59 (broken):

    Code:
    MAILTO=''
    SHELL='/usr/sbin/jk_chrootsh'
    
    */5     *       *       *       *       web59   /usr/bin/php7.2 -q /var/www/clients/client10/web59/web/crons/cron.php  >/dev/null 2>&1 >>/private/cron.log 2>>/private/cron_error.log
    *       *       *       *       *       web59   /usr/bin/php7.2 -q /var/www/clients/client10/web59/web/crons/pop.php  >/dev/null 2>&1 >>/private/cron.log 2>>/private/cron_error.log
    *       20      *       *       *       web59   /usr/bin/php7.2 -q /var/www/clients/client10/web59/web/modules/addons/mgCRM2/cron.php  >/dev/null 2>&1
     
  9. Dennis_sp

    Dennis_sp Member

    I can confirm that after deleting the jobs from GUI and re-creating them i now i have a ispc_web59 file. Will know for sure if it's working tomorrow.
     
  10. florian030

    florian030 Well-Known Member HowtoForge Supporter

    note the different shell. with /usr/sbin/jk_chrootsh you can not use /var/www/clients..., you must use /web/....

    if you create a cron as admin, the cron-type is always full, even if the limit for the client is chrooted.
    when the client opens and saves the cron-job (no changes in the cron needed), the cron will be set to client limit (chrooted) but the path will not be updated when you use a placeholder in the command-line and the command does not starts with the placeholder (i.e. /usr/bin/...).
     
  11. Dennis_sp

    Dennis_sp Member

    I understand. Maybe in a future version of ISPconfig there should be a link to the client limits page from the cronjobs page when you are logged in as admin. Or maybe introduce a general setting that allows you to install ISPconfig without the clients feature, or is that a crazy idea? In my case i only run my own websites with ISPconfig or is this very uncommon?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    That's quite common and that is why such systems that don't have clients are not affected by what Florian mentioned. There is no need to use the client feature on a system that does not host sites for external clients as you can use all functions without having to add a client in ISPConfig. And even if you have added clients without needing them would not affect you when you administer your system with a single user as it's done usually.
     
  13. florian030

    florian030 Well-Known Member HowtoForge Supporter

    i fixed this on my setup and i will add the changes to git a little bite later - need to find the diffs ;)
     
    Th0m likes this.

Share This Page