Page 1 of 1

How to configure cron job?

Posted: 21 Jan 2025, 11:31
by Joselyne
Hello,

Email reporting is working when I execute the script via web.
How can I set a cronjob/scheduled job for "/my MantisBT path/plugins/EmailReporting/scripts/bug_report_mail.php"
I'm using Windows OS and would like the script to be executed every 5 minutes?

Thanks

Re: How to configure cron job?

Posted: 21 Jan 2025, 18:31
by SL-Gundam
Please provide a screenshot of the result you're seeing
Linux or Windows?
Which version of the above?
Please provide the exact commandline you're trying. Try it in cmd before adding it to a scheduled task.

Re: How to configure cron job?

Posted: 23 Jan 2025, 08:14
by Joselyne
Hi,

I read in this forum the way the script is written and i have tried it:

Created a ".sh" file in which i put the two lines:

# !/bin/bash
/path/to/php/bin/php /path/to/plugins/EmailReporting/scripts/bug_report_mail.php

where /path/to/php/bin/php is C:\xampp\php\php.exe and defined the 2nd path.

But when I execute the file, it seems to open the file containing the lines and ask how I want to open the file (see file in attachment), not giving the output as desired.

Do you have an idea?

I'm on Windows Server 2022 Standard

Thanks

Re: How to configure cron job?

Posted: 23 Jan 2025, 15:33
by cas
On windows you cannot wotk with a sh file. You need to make a bat- or cmd- file

Re: How to configure cron job?

Posted: 24 Jan 2025, 12:54
by Joselyne
Thanks.
I have changed the extension and that works fine.