Page 1 of 1

POP3 fetching- Cronjob - WAMP-server

Posted: Fri Jul 12, 2013 7:15 pm
by Chris!
Every one...

I would like some help with the pop3 fetching.
I have succesfully installed HESK on a WAMP-server (windows based). The challenge now is to get a 'cronjob' running every 5 minutes to execute the script. However, windows does not have CRONTAB, that is a LINUX feature. So we need to use the task scheduler.

How to go about getting the pop3 fetching script to run automatically?
Any feedback is greatly appreciated!

Chris!

Re: POP3 fetching- Cronjob - WAMP-server

Posted: Sat Jul 13, 2013 8:32 am
by Klemen
Yes, on Windows Task scheduler must be used.

You will also need a simple program that can fetch web pages, for example wget.

Here is how I would do it (this is on Windows 7, other Windows version should have it similar):

0. Before anything else, make sure the pop3_fetch.php script works fine if you open it in the browser:

Code: Select all

http://localhost/hesk/inc/mail/hesk_pop3.php
1. Download and install wget for windows, for example to "C:\wget":

2. In Windows open Task scheduler

3. Click "Create Task..."

4. Give the task a name, for example "HESK POP3 fetch"

5. On the "Triggers" tab click "New..."

The "Begin the task" should be set "On a schedule" and "Daily" selected.
Under Advanced settings check "Repeat task every 5 minutes (or 10 minutes)" and Duration "Indefinitely".
Other options (like stop the task or expire) shouldn't be selected.

6. On "Actions" tab click "New..."

Action should be "Start a program"
Program should be wget.exe, for example "C:\wget\bin\wget.exe"
Arguments should be:

Code: Select all

-q -O nul http://localhost/hesk/inc/mail/hesk_pop3.php
(change the URL to your local hesk_pop3.php URL of course)

7. On "Conditions" tab uncheck the option "Start the task only if the computer is on AC power"

8. On "Settings" tab uncheck the setting "Stop the task if it runs longer than" so that this task should run indefinitely.


That should do the trick.