Another cron question

Discussion in 'General' started by dmgeurts, Feb 20, 2020.

  1. dmgeurts

    dmgeurts Member

    For a civicrm install I've created a cron which according to the time stamps on the cron.log file is run every 5 minutes. But it't not doing what it should. If I run the command from terminal as the web user it does execute just fine. Where am I going wrong?

    Code:
    cat /etc/cron.d/ispc_chrooted_web21
    MAILTO=''
    SHELL='/usr/sbin/jk_chrootsh'
    
    */5     *       *       *       *       web21   /usr/bin/php /private/cv.phar api job.execute --user=civi-user >>/private/cron.log 2>>/private/cron_error.log #domain.uk
    Content of /private/
    Code:
    ll ../../private/
    total 1344
    drwx--x---  2 web21 client1    4096 Feb 19 17:18 ./
    drwxr-xr-x 20 root  root       4096 Feb 19 00:05 ../
    -rw-r--r--  1 web21 client1       0 Apr 18  2018 cron_error.log
    -rw-r--r--  1 web21 client1       0 Apr 18  2018 cron.log
    -rw-r--r--  1 web21 client1       0 Feb 20 18:30 cron_wget.log
    -rwxr-xr-x  1 web21 client1 1366454 Dec 14 02:40 cv.phar*
    Actually, the dated on those log files may be a hint? There are two cron jobs, the other is a simple wget that runs every 15 minutes. So the cron.log file isn't updated. Why isn't it running? How do I find out?
    The client is set to chrooted cron
     
    Last edited: Feb 20, 2020
  2. Steini86

    Steini86 Active Member

    Does this file exist in your chroot?
    https://www.faqforge.com/linux/add-php-in-ssh-jail-ispconfig-3/
    Do you run it in the chrootsh?
    Can you try with "/usr/bin/php -f /private/cv.phar"
     
  3. dmgeurts

    dmgeurts Member

    1) This is chrooted cron so not user based. The jailkit cron chrooted applications are: /usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php
    2) Not sure how to run a command in chrootsh when I didn't create an ssh user and only use the chrooted cron. Most likely due to ignorance on my part.
    3) Will give that a go and update here. Adding "-f" into the ispconfig website chrooted cronjob hasn't made a difference. cron.log shows no entries when it should.
    Thank you!
    Code:
    Feb 21 01:50:01 susie CRON[32479]: (web21) CMD (/usr/bin/php -f /private/cv.phar api job.execute --user=admin >>/private/cron.log 2>>/private/cron_error.log #doma.in)
    According to syslog the cronjob runs but according to civicrm it doesn't. afaik it should at least update the timestamp of the cron.log file
     
    Last edited: Feb 21, 2020

Share This Page