tags:

views:

35

answers:

2

I run a website and my subscriber base is gradually increasing.

I had to manually batch my subscribers, that is Batch A (1-700), Batch B (701 - 1400) etc. and manually trigger the email sending every hour.

In addition, to sending them emails i want to perform some other tasks along side the email.

I believe there should be a way of triggering the message send once from the web interface (that is from my website backend, pls not from the command line), and it batches the emails and processes automatically hourly.

Looking forward to replies on how i can get it done.

Thanks in advance.

A: 

In UNIX-like systems, this can be done with cron. In Windows, see the Task Scheduler, schtasks or at.

If you don't have access to these tools, you cannot programatically run scripts with a given period (short of having another machine call your scripts via HTTP).

Artefacto
Yes you can. It's a php hack that uses page calls to trigger a script at certain times.
Powertieke
@Power Then you have another machine calling your scripts periodically (in this case, through a web browser).
Artefacto
To be fair often times you see systems that trigger when a user visits a webpage and the system has not performed its tasks for this hour. Not the most reliable thing but with enough traffic it works. I used that when I had not access to cron. But nowadyas everyone should have cron.
Iznogood
Most servers/sites have enough traffic to run scheduled scripts with moderate accuracy. I wouldn't go scheduling with 5 min. intervals, but for jobs that need to run twice a day, where it doesnt't matter if it fires a couple of minutes late, this does the job...
Powertieke
pls i dont quite get the php hack that uses page calls to trigger a script at certain times, does it mean ill embed a trigger on all or most of my pages?
Ogugua Belonwu
Yes, something like that. The package I recommend in my answer works this way (So you don't have to build it yourself).
Powertieke
A: 

If you are unable to schedule cron jobs on your server (as is the case with most cheap hosting solutions), there are some pure php alternatives to run scheduled jobs: phpjobscheduler is one of those alternatives.

Powertieke