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 🙂

            so from now onward the tickets get generated will show me in IST time. Right. But still it shows Asia/Jerusalem. I want to change it to Asia/ Kolkata.

            Below are the screenshots that i have made to Asia/Kolkata for admin as well as agent.

            • RBGE replied to this.

              RBGE the cron is taking around 10min max to generate a ticket.
              this is my cron command- */5 * * * * /usr/bin/php -q /var/www/html/osticket/api/cron.php

              What is the issue. exactly. I want the tickets to be generated in 1-2minutes. What should i do.

              • RBGE replied to this.

                amarnath You've got your locale set to "English" - the thing to remember here is that osTicket is developed in America, so it really means "Backwards English" 😉 which uses a 12 hour clock. If you set it to any other English format, it should go 24 hour (I use English (United Kingdom) )

                amarnath If you change the 5 to a 2 (or even just get rid of the /5 and leave it as * to run every minute) that should work.

                Please help me to change Asia/Jerusalem to Asia/Kolkata.

                • RBGE replied to this.

                  There should be a change in include/class.timezone.php

                  I've run into this issue when using Indian Standard Time IST. PHP interprets it as Israel Standard Time.Equivalent +5.30 tz is Sri Lankan Standard Time SLST which is not detected by PHP. So I had to use a dirty modification to include/class.timezone.php174 return 'Europe/London';175 }176 // Override IST to India Time.177 if ($TZ === 'IST') {178 return 'Asia/Kolkata';179 }180 // Forbid timezone abbreviations like 'CDT'181 elseif ($TZ !== 'UTC' && strpos($TZ, '/') === false) {182 // Attempt to lookup based on the abbreviationLeaving this here just in case this is not fixed and someone runs into this issue and could not find a similar timezone to switch to.
                  I dont know how to do it. Just refer and tell. I refered it in one of your forums by searching OSTicket v1.10-stable Time issue.

                  cgi.fix_pathinfo "1" is recommended if AJAX is not working. I have change it to '1' but still show thw error.

                  While i was changing my manager in department . Its taking time and got crash. See the screenshots.