I've searched for this on the forums here and did find this here https://forum.osticket.com/d/94293-resolved-please-help-creating-cron-job/8 But we still can't get it to work. we have autofetch turned off and this is what the crontab file looks like. Am i missing something? The paths to these files are correct. the crontab file is located in /etc

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

*/1 * * * * /usr/bin/php /var/www/osticket/api/cron.php

    mattejacob

    If you run /usr/bin/php --version on the server's command line does it actually work and return the correct version of PHP (that matches what osTicket is running)?

    Cheers.

    as far as i can tell.
    $ /usr/bin/php --version
    PHP 8.1.28 (cli) (built: Apr 10 2024 05:53:50) (NTS gcc x86_64)
    Copyright (c) The PHP Group
    Zend Engine v4.1.28, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.28, Copyright (c), by Zend Technologies

    how do i tell what version osticket is actually running?

      mattejacob

      If you can confirm that then it sounds like /var/www/osticket/api/cron.php is not your actual path to your cron file. This needs to be the full path to your osTicket folder and the api/cron.php file.

      Cheers.

      osticket is running the correct version and that path to cron.php is also correct. so i'm not too sure what else it could be.

        mattejacob

        Did you enable fetching at the mailbox level (within the Remote Mailbox tab) and the global level (Admin Panel > Emails > Settings > Email Fetching > Enable)? If so then check your Admin Panel > Dashboard > System Logs for any Mail Fetcher errors.

        Cheers.

        the answer to both those is yes, and i've disabled the autofetch cron. and the only warning i can see is from sept 10, excessive errors processing emails. which happens every now and then. but nothing from that last few days when i put the cron job in.

        mattejacob

        Btw you can set your Default Log Level to DEBUG in your system settings and if the cron runs successfully you'll see a Cron Job entry in your System Logs that says it executed successfully.

        Cheers.

        I did that and the job isn't showing, if i turn auto cron on those log messages show. so there must be something in my config that is messed up? i'm not sure.

          mattejacob

          Something with the cron apparently. I would instead modify the Apache user’s cron file to see if that changes things (eg. if your Apache user is called apache the command would be crontab -e apache).

          Cheers.

          well, some progress. if i run the command php /var/www/osticket/api/cron.php
          it will run. but it only runs once, and i do see it in the debug logs and it runs properly, pulls the ticket in, sends out and email and it all looks normal. so it seems to be working, but it just isn't running every min like it's supposed to.

            mattejacob

            Then something is wrong with your cron system of the user running cron doesn’t have needed permissions.

            Cheers.

            ok. well. i'm kinda lost as to how to fix it. i'll just change it back to the way it was. we've been using this for 2 years and it works fine. it's just when no one is logged in, i.e. the weekend, we don't see tickets because there is no activity to trigger it to pull them in. i was just hoping to fix that. I've set up cron jobs before and never really had any issues. Not a big deal. i'll just switch it back.

            Write a Reply...