@ntozier @greezybacon
I have sucessfully installed osticket 1.12v in Ubuntu18.04 . I have configured gmail account and enable the auto-cron.Its fetching mail and generate new tickets when a agents get log into it.
I want to configure a externel task scheduler for osticket.
my question is i have setup cronjob for it but not able to fetch mails and generate new tickets at all. I have gone through your user guide to setup task scheduler but i dont get any of the point to do it. Thanks for the help

  1. Should i need a mail fetcher script .
  2. After generating API were i must use it in cronjob .
  3. What should must be the path in the cronjob to run the externel task scheduler with email fetch script.
  4. Please see the screen shot of crontab that i have setup. I am new for setting up cronjob as well as locating API key.

Common gotcha with cron is not leaving a blank line at the end. I see you don't have one.

Make sure that command is executed manually first before automating it. If your cli version of PHP needs that exact command to run, great, but it might be different mate. which php should tell you the correct path, if it's even installed, a webserver PHP install isn't necessarily a command line PHP.

Another thing you can try is removing the output redirection (>/dev/nul &2>1 etc). That's so your cron can email you any errors, when it's working properly you can put that back in.

    Also you are running as root.
    Ubuntu last I checked used the user www-data for Apache and web.

    You do not need to use an API key if you are running locally. API keys are used for remote cron.

      You are right ntozier it used www-datafor apache and web. how should i run it.
      Grizly Exactly what should i do sir. Please tell . I was just waiting for someones reply. I am new for this kind of process. I will be thank full it you guide me step by step that how i should do all this to run my externel task scheduler.

      I must admit across every Linux system I've used I have never once seen a cron setup outside of osTicket where the username is specified after the schedule. I've always used the command directly after the schedule with the job set in the desired user's crontab (even the commented out text in the screenshot above suggests this).

      crontab -u www-data -e while logged in as your admin account would set the cron to run as www-data in this way, but as I've already posted my setup in an earlier thread I'll keep the semantics out of this one 😇

        hello @RBGE
        So i dont need a externel script to fetch my emails. I made a python script for it.

        I have made changes in crontab using following users

        1. Login as root>crontab -e > /5 * * * /usr/bin/php -q /var/www/html/osticket/api/cron.php>:wq>reload cron
        2. Login as local user(amar)>crontab -e > /5 * * * /usr/bin/php -q /var/www/html/osticket/api/cron.php>:wq>reload cron.
        3. Login as root>crontab -u www-data -e > /5 * * * /usr/bin/php -q /var/www/html/osticket/api/cron.php>:wq>reload cron.
          Exactly what should i use in the above users. Thanks. I am sharing some screen shots that cron is executing.
        • RBGE replied to this.

          You do not need an external script if you are running cron locally.

          You would run the cron task as www-data.

            thanks ntozier RBGE @Grizly . Next i need help in setting up remote cron . And how i can make all the tickets generated time from UTC to IST.

            If your running cron locally... why would you need to setup remove cron? That sounds like a recipe for collision to me.

            Your timezone can and should be be set in multiple locations:
            php.ini
            mysql server
            osTicket: Admin panel -> Settings -> System: Default Time Zone.
            osTicket Agent profile: Agent panel -> Profile -> Preferences -> Localization.

            amarnath You have three separate cron jobs all doing the same thing. While it won't really cause any serious problems, it's not exactly efficient. I think you'll get separate suggestions from everyone here as to the best way of doing things, but mine would be to get rid of all the existing cron setups and start again with just number 3.

            As ntozier mentioned, the timezone does need to be set in multiple places. For PHP, go into php.ini and look for the line starting date.timezone making sure it's not commented out, then set it to the relevant value according to this page: https://www.php.net/manual/en/timezones.php - you'll also need to ensure the server itself is running on the correct timezone.

            Iwant to change the time zone as high lighted in the screen shot.

            • RBGE replied to this.

              amarnath Okay, I can see that PHP is currently set to Asia/Kolkata, so you'd want to go to your php.ini file, find the date.timezone line and change it to

              date.timezone = "Asia/Jerusalem"

              Obviously the exact length of php.ini can vary, but on mine it's on line 972. Remember to restart your web server after this change.

              i want to change time zone Asia/Jerusalem to Asia/kolkata. Were i can do this changes.

              • RBGE replied to this.

                See the below screen shot i want the tickets timing should be as Asia/Kolkata timezone format.See my system time and the ticket generated time. Now its diffrent.

                amarnath Ah, okay then. MySQL (and MariaDB) by default will pick up the time from the system - is this set correctly? You can run sudo dpkg-reconfigure tzdata to verify this, making sure to restart MySQL afterwards if anything changes. If you need to somehow set the timezone manually in MySQL, have a look at https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html as there are a few ways of doing so, and if the timezone has already been manually set, it'll need changed back.

                Setting the layout in osTicket is done via Admin -> Settings -> System in the 'Date and time options' section. Make sure the timezone is set properly and locale is set to default (or change it manually if locale is somehow wrong). It's also worth checking your profile to make sure you're not over-riding the default value.

                +--------------------+---------------------+
                | @@global.time_zone | @@session.time_zone |
                +--------------------+---------------------+
                | SYSTEM | SYSTEM |
                +--------------------+---------------------+

                • RBGE replied to this.

                  amarnath Perfect! That's as it should be. Just need to set the system default timezone using dpkg-reconfigure 🙂