Question:

I installed osTicket on my server, and I want to set up a cron job to trigger osTicket's cron job script. What should I do to set up the cron job?

Answer:

Our webcron service is best for triggering osTicket's cron job script. Just follow below simple steps to configure cron job for your osTicket:

  1. Find rcron.php in "scripts" folder and change:

    1) line 24 from

    'url'=>'http://yourdomain.com/support/api/tasks/cron',

    to

    'url'=>'{your osticket installed location}/api/tasks/cron',

    NOTE: Don't change "/api/tasks/cron"!

    2) line 25 from

    'key'=>'API KEY HERE'

    to

    'key'=>'your generated API key'

    NOTE: Please use your web server's IP (on which your osticket was installed) to generate the API key. Check below:


    Set up osTicket API key

    Edit the osTicket rcron.php file
  2. Rename the filename from rcron.php to a secret name (for example 123rcron.php). Or you can upload it to a secret location on your web server later without changing the filename.

  3. Upload 123rcron.php to your web server (to any location that can be accessed via HTTP). For example, http://www.example.com/123rcron.php.

  4. Open your cron job dashboard, click on " Cron Job" button.
  5. In field "URL to call", enter http://www.example.com/rcron.php (replace www.example.com with your install location). Choose an appropriate cron job execution frequancy (for osTicket, we recommend to have the cron job run "every 5 minutes"). Checkout below screenshot:

    Set up cron job for osTicket
  6. If necessary, finish the other optional settings.
  7. Click "Create Cron Job" button. You're done! EasyCron will trigger your osTicket's cron job script dutifully according to your time setting.
  8. If you haven't registered your EasyCron account yet, click on the "add a password" link on the top to add an email and password to your account.