How to configure cron job?

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
Joselyne
Posts: 62
Joined: 14 Dec 2023, 15:59

How to configure cron job?

Post 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
SL-Gundam
Posts: 754
Joined: 06 Jul 2011, 14:17

Re: How to configure cron job?

Post 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.
Joselyne
Posts: 62
Joined: 14 Dec 2023, 15:59

Re: How to configure cron job?

Post 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
Attachments
file.png
file.png (7.25 KiB) Viewed 6778 times
cas
Posts: 1768
Joined: 11 Mar 2006, 16:08
Contact:

Re: How to configure cron job?

Post by cas »

On windows you cannot wotk with a sh file. You need to make a bat- or cmd- file
Joselyne
Posts: 62
Joined: 14 Dec 2023, 15:59

Re: How to configure cron job?

Post by Joselyne »

Thanks.
I have changed the extension and that works fine.
Post Reply