How to set up a phplist cron job in Windows (10)?

Pursuant to a related topic: is there a tutorial anywhere that explains the nitty gritty details of setting up a cron job on Windows? I’ve seen this in threads:

php-cli -q /home/puckettpublishing/public_html/phplist/admin/index.php -pprocessqueue -c/home/puckettpublishing/public_html/phplist/config/config.php >/dev/null

This is done via cpanel? I confess I am a bit unclear on the entities involved. There’s “scheduled task” in Windows. “cpanel” is what I access on the host site (in my case, HostGator), is it not? The example above was from a forum listing that had the job every 15 minutes every day. I only send out my list once a week, so that seems excessive.

I am only grasping at straws here, but I’m supposing the sequence of events would be:

  1. Use phplist admin to Create/Send a Message
  2. I then (in browser world, anyway), select the list to which I want to send; not sure how one would do that in this scenario
  3. Then I suppose the “eternal” cron job would see the non-empty queue and start processing (until the queue is empty)

So my question is:
How far off the mark am I? What did I miss? What did I get wrong? (Everything is an acceptable answer :grin:) If this is how this is done, how does one specify which list to use?

Appreciate any illumination anyone can shed on my ignorance.

Hi @chuckpuckett,

I’m assuming that your server with phpList on hostgator is running unix? If so, you would want to setup your cron job on that server, not on your local machine that you use to browse the internet…

in cpanel on the hostgator host, it’s called a ‘scheduled task’.

instructions here:

https://www.phplist.org/manual/ch036_setting-up-your-cron.xhtml

also, if you are using a more recent version of phpList, you can use the ‘secret’ to setup a cron job, as documented here:

https://resources.phplist.com/system/remote_processing

in the end, your cron command will look something like this:

‘wget http(s)://yoursite.com/lists/admin/?page=processqueue&secret=XXXX’

set it to run every minute…

Also, if you want me to set it up for you, I do this as a service, for a small charge. If you are interested, send me an email: dan@phplistsupport.com

1 Like

Okay, making some progress. Go tthe cron job running (I created a list with just me to debug this and using it to test the cron cmd line).

Here’s what I put in the cron job

/opt/php52/bin/php-cgi /home2/cpuckett/public_html/thmaillist/admin/index.php - processqueue -c /home2/cpuckett/public_html/thmaillist/config/config.php $*

Now, when the cron job runs, I get an email with a lot of HTML. When I looked at the HTML as a page, it’s a form saying “This document requires you to log in”, and a form for Name and Password.

How do I supply this in the command line?
Or, rather, what is the accepted mechansim to deal with this?

Thanks. I feel like I’m close!

if you are using a more recent version of phpList, you can use the ‘secret’ to setup a cron job, as documented here:

https://resources.phplist.com/system/remote_processing

in the end, your cron command will look something like this:

‘wget http(s)://yoursite.com/lists/admin/?page=processqueue&secret=XXXX’

set it to run every minute…

what version is sufficient to take this approach?

version 3.2 or higher. I’m assuming you are installing phplist on a linux box, correct?

hello I installed phplist on a windows pc with wamp I wanted to know if you have solved the sending of emails queued through a dos command

Thank you