cron job

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • SpeedBullet
    replied
    I've had some issues with cron not running as well. I use the /etc/cron.d/ directory with a file in it named espocrm. This was what's in it (as recommended by espocrm):

    Code:
    * * * * * /usr/bin/php -f /path/to/espocrm/current/cron.php > /dev/null 2>&1
    I compared to other cron files in that directory and I had to change the line to include the username (the user that should run the script). It should be the user that's owning the file cron.php. So for example if the user bob is owner of the cron.php file, change your cron accordingly:

    Code:
    * * * * * bob /usr/bin/php -f /path/to/espocrm/current/cron.php > /dev/null 2>&1
    I hope this helps. This did the trick for me and now I have cron running for espo! Sweet.

    Leave a comment:


  • bkny
    replied
    Originally posted by yurikuzn
    The best thing is to debug starting from cron.php file. But it needs some knowledge of php.
    Thank you. I've about run thru my capabilities of what I can do on my own. 52

    Leave a comment:


  • yuri
    replied
    The best thing is to debug starting from cron.php file. But it needs some knowledge of php.

    Leave a comment:


  • bkny
    replied
    Originally posted by yurikuzn
    If there was delay it's a good sign. Anything in scheduled job's log? Try to run it one more time.

    In crontab use php instead of /usr/local/bin/php


    Originally posted by bkny

    yes, a minor delay, 1-2 seconds or so before I get the prompt back.
    I've set up a dozen test calls.
    I've manually run " php cron.php " a few DOZENS of times via SSH, no new entries in the logs.


    I will try the edit you mention above and see what happens.

    Thank you.

    I tried the edit for the crontab , no difference, but for the errors I was emailed from my server on the crontab, "php" not found.

    I tried running the " php cron.php " a few more times from the command line, same results, minor delay, but no new entries in the crm logs.

    I changed my crontab back to reflect the php path again, and no more errors being emailed to me.
    1845
    Last edited by bkny; 04-07-2016, 03:33 PM.

    Leave a comment:


  • bkny
    replied
    Originally posted by yurikuzn
    If there was delay it's a good sign. Anything in scheduled job's log? Try to run it one more time.

    In crontab use php instead of /usr/local/bin/php
    yes, a minor delay, 1-2 seconds or so before I get the prompt back.
    I've set up a dozen test calls.
    I've manually run " php cron.php " a few DOZENS of times via SSH, no new entries in the logs.


    I will try the edit you mention above and see what happens.

    Thank you.

    1791

    Leave a comment:


  • yuri
    replied
    If there was delay it's a good sign. Anything in scheduled job's log? Try to run it one more time.

    In crontab use php instead of /usr/local/bin/php

    Leave a comment:


  • bkny
    replied
    Originally posted by yurikuzn
    Did you try to run cron.php manually in command line interface:
    php cron.php
    or
    /usr/local/bin/php cron.php
    yes, I went in via SSH, made my way to the CRM directory where the cron.php is, and executed via the command line syntax of "php cron.php"
    You can see the system wait a moment, and return to the prompt. no errors no nothing.
    I have it set up to check the personal email, and that's not happening either, so as you mentioned earlier, seems the cron.php isn't being run... it just doesnt seem to have an effect on the software.
    I looked in the cron.php, and looked for the file it's calling for, and its where it's supposed to be, and in that looked for what its referencing and it's there.
    I changed permissions to 754 for all 3 files, still NG.
    1008

    Leave a comment:


  • yuri
    replied
    Did you try to run cron.php manually in command line interface:
    php cron.php
    or
    /usr/local/bin/php cron.php

    Leave a comment:


  • bkny
    replied
    So I SSH and doubled check the path, and asked one of the admins, and it is as it is in the cronjob.
    And again, no errors are being logged, and I can execute the cron.php manually and nothing happens (reminders don't go out and no new log entries in " Administration > Scheduled Jobs > Send Email Reminders > Logs " .

    I looked in the cron.php, and looked for the file it's calling for, and its where it's supposed to be, and in that looked for what its referencing and it's there.
    I changed permissions to 754 for all 3, still NG.

    I'm at a loss for what to look for next, 1696
    Last edited by bkny; 04-06-2016, 05:30 PM.

    Leave a comment:


  • bkny
    replied
    Originally posted by yurikuzn
    Yes. It should log even no email were sent. Maybe /usr/local/bin/php is not actual and there is another php in your system,
    Thank you. 1583
    I'll double check on the path.

    I would *think* it's good since the cronjob isn't creating an error log.
    I have a few others that are sending me errors, since I removed some logs these other cronjobs are looking to processing, so it *seems* my cronjob error reporting is working.
    Just incase, I cleaned out my crontab of the other cronjobs, and left my Espocrm cronjob, and still no difference (just no longer getting errors from the other cron jobs).

    Leave a comment:


  • yuri
    replied
    Yes. It should log even no email were sent. Maybe /usr/local/bin/php is not actual and there is another php in your system,

    Leave a comment:


  • bkny
    replied
    995
    FYI, the logs were re-reviewed, and no errors are being logged, and it appears to be calling the cron.php w/o a problem.

    So,
    I set up another test call, set up popups and email reminders for on time, 5 mins, and 10 mins.
    I entered my server via SSH, and manually ran the cron.php, every 2 minutes.
    The popups went off in a timely manner perfectly.
    But none of the email reminders went out, even with manually running the cron.php.
    There are no new entries in " Administration > Scheduled Jobs > Send Email Reminders > Logs " .

    Here's what's in the cron.php file :

    Code:
    <?php
    /************************************************************************
     * This file is part of EspoCRM.
     *
     * EspoCRM - Open Source CRM application.
     * Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
     * Website: http://www.espocrm.com
     *
     * EspoCRM is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * EspoCRM is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with EspoCRM. If not, see http://www.gnu.org/licenses/.
     *
     * The interactive user interfaces in modified source and object code versions
     * of this program must display Appropriate Legal Notices, as required under
     * Section 5 of the GNU General Public License version 3.
     *
     * In accordance with Section 7(b) of the GNU General Public License version 3,
     * these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
     ************************************************************************/
    
    $sapiName = php_sapi_name();
    
    if (substr($sapiName, 0, 3) != 'cli') {
        die("Cron can be run only via CLI");
    }
    
    include "bootstrap.php";
    
    $app = new \Espo\Core\Application();
    $app->runCron();

    Leave a comment:


  • bkny
    replied
    Originally posted by yurikuzn
    Yes. You do everything right. There should be multiple records in Log panel, creating every 2 minutes. If you see only one it means cron is not running. Check server error log; find out why cron.php is not running.

    * * * * * /usr/local/bin/php -f /usr/www/users/xxxx/xxxx/crm/cron.php > /dev/null 2>&1

    we did check, no errors, and the logs show the cronjob above is running every minute.
    But I haven't been able to confirm that the cron.php is actually running.
    While I have xxxx out parts of the path shown above for privacy, following the actual path in the cronjob I did find the cron.php, so the path is correct and it's there.
    What should the permission level be for cron.php ?


    Originally posted by yurikuzn
    ........There should be multiple records in Log panel, creating every 2 minutes. If you see only one it means cron is not running.........
    So every time the cron.php runs, no matter if it sent a scheduled email or not, it should make a log on that page ?

    TIA
    883
    Last edited by bkny; 04-05-2016, 06:25 PM.

    Leave a comment:


  • yuri
    replied
    Yes. You do everything right. There should be multiple records in Log panel, creating every 2 minutes. If you see only one it means cron is not running. Check server error log; find out why cron.php is not running.

    Leave a comment:


  • bkny
    replied
    Originally posted by yurikuzn
    Email should be sent to Assigned User. Not to contacts. I just tested and it worked.
    I am the assigned user for the Calls I created and is shown in the Call detail screen (and expected the reminder to go to my email address as I entered in Espocrm for my user info)
    Is that what your referencing?
    If not, where are you referencing?

    ( FYI, if I go into my User page, and click on my email address, from within Espocrm I can send an email to myself, and it's fine. So all the email addresses and authentications are fine and functioning. )




    TIA 105
    Last edited by bkny; 04-05-2016, 12:36 PM.

    Leave a comment:

Working...