Page 1 of 1

Setting up Scheduled Task for overdue tickets

Posted: Sun Jun 12, 2022 5:05 pm
by markdewet
Script URL: /cron/email_overdue_tickets.php
Version of script: 3.2.5
Hosting company: Hosted at home on XAMPP 7.4.29 on Windows 10
URL of phpinfo.php: Not sure how to upload link from my PC however phpinfo displays fine
URL of session_test.php: N/A
What terms did you try when SEARCHING for a solution:

Write your message below:
Hi, I have recently re-installed Hesk as I had an issue with IIS, so moved to XAMPP. All is working 100% so far, but now I would like to set up the scheduled task in Windows for the Overdue Tickets email script/cronjob. I followed the instructions for Windows as per this link: https://www.hesk.com/knowledgebase/?article=103 but when I test run the sheduled task the page opens up with the text: #!/usr/bin/php -q displayed. I am sure this is not correct so where have gone wrong please?

Re: Setting up Scheduled Task for overdue tickets

Posted: Sun Jun 12, 2022 5:35 pm
by Klemen
You can ignore the "#!/usr/bin/php -q" message as it's the Unix shebang line.

If you turn Debug mode ON in Admin > Settings > Help desk > Features, you should see the full output message. Debug mode should be disabled for live use though.

Re: Setting up Scheduled Task for overdue tickets

Posted: Sun Jun 12, 2022 5:47 pm
by markdewet
@Klemen,
Thank you so much! It seems it is working as it should as I now get the following: #!/usr/bin/php -q Starting overdue tickets notification process Found 0 tickets that are overdue.
Thank you again. Is there any way to have the "Starting overdue tickets notification process Found 0 tickets that are overdue." display instead of "#!/usr/bin/php -q" or alternatively disable/hide the "#!/usr/bin/php -q" message?

Re: Setting up Scheduled Task for overdue tickets

Posted: Sun Jun 12, 2022 6:22 pm
by Klemen
You can remove the entire

Code: Select all

#!/usr/bin/php -q
line from the file itself, it is not needed on Windows.

I strongly recommend keeping debug mode OFF for live help desks. You can enable it manually for this file only by adding

Code: Select all

$hesk_settings['debug_mode']=1;
after line

Code: Select all

require(HESK_PATH . 'hesk_settings.inc.php');

Re: Setting up Scheduled Task for overdue tickets

Posted: Sun Jun 12, 2022 7:23 pm
by markdewet
@Klemen,
Again, thank you so much! I have disabled DEBUG Mode in settings and removed the line as mentioned, then inserted the line as mentioned to enable the debug for the php file only and all is working perfectly. I cannot thank you enough!