So I started running into duplicate ticket issues with auto-cron...

I am so confused about setting up cron.php. It keeps saying to add */5 * * * * nobody /path/to/php /path/to/api/cron.php

In the cron.php file, it currently says "<?php
/*********************************************************************
cron.php

File to handle LOCAL cron job calls.

Peter Rotich <peter@osticket.com>
Copyright (c)  2006-2013 osTicket
http://www.osticket.com

Released under the GNU General Public License WITHOUT ANY WARRANTY.
See LICENSE.TXT for details.

vim: expandtab sw=4 ts=4 sts=4:

**********************************************************************/
@chdir(dirname(FILE).'/'); //Change dir.
require('api.inc.php');

if (!osTicket::is_cli())
die(__('cron.php only supports local cron calls - use http -> api/tasks/cron'));

require_once(INCLUDE_DIR.'api.cron.php');
LocalCronApiController::call();
?>"

Do I just replace this entire code? I'm running osticket on a Windows Server environment. Do I also need to setup a task scheduler? There's so many conflicting information and the instructions on osticket is not clear.

cron (*NIX) on Windows is Windows Task Scheduler.
You seem to be confusing cron.php [a file from the distribution archive] with cron.
If your OS is Windows then you do not have cron.

So yes you would use Windows Task Schdeuler instead.
In either case [Cron or WTS] you schedule something to run. In this case its a call to cron.php.

Do I need to edit anything in the cron.php file?

Thanks I got it!

Right now I have my emails to fetch every 1 minute and my bat file is running every 1 minute as well. Would this be an issue? What would you recommend?

My task scheduler is set to run every minute.
My osTicket settings are set to every 2 minutes, 10 messages.

I do this to avoid collision, knowing that it will only run every other cron/task sched run.
If it takes more than a minute to transfer 10 emails there is a problem... but if takes more then 2 minutes there is a huge problem. Running too often can cause crons/task scheduler processes to collide and result in duplicate tickets.

Thanks a lot ntozier! You've been of great help!

Very welcome. Should I mark this thread as resolved and close it?

Write a Reply...