FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Hourly script
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Hourly script [message #173327 is a reply to message #173313] Sun, 03 April 2011 14:22 Go to previous messageGo to previous message
Mr. B-o-B is currently offline  Mr. B-o-B
Messages: 42
Registered: April 2011
Karma:
Member
Jerry Stuckle cried from the depths of the abyss...

> On 4/2/2011 8:18 PM, Mr. B-o-B wrote:
>> On 4/2/2011 7:09 PM, Jerry Stuckle cried from the depths of the abyss:
>>> On 4/2/2011 6:18 PM, Mr. B-o-B wrote:
>>>> On 4/2/2011 3:37 PM, P E Schoen cried from the depths of the abyss:
>>>> > "Question Boy" wrote in message
>>>> > news:bc56da6b-df1c-4a56-9789-78fd24c0268d(at)s9g2000yqm(dot)googlegroups(dot)com...
>>>> >
>>>> >
>>>> >> I built a mailing tool for a custom database for a charity
>>>> >> organisation and it does work, but our host has a limit of
>>>> >> 200 e-mails an hour. As it stands, someone has to manually
>>>> >> send out 200 e-mails every hour until the whole lot is processed
>>>> >> (2800 recipients and growing). I was simply wondering if there
>>>> >> is a way to modify/add a bit of code to process the entire
>>>> >> recordset in batches of 200 records per hour?
>>>> >
>>>> > The other responses are probably all you need. The CRON job seems to
>>>> > require access to the UNIX environment, and I'm not sure how that might
>>>> > be done if you are working from a Windows platform. There are many ways
>>>> > to do this, but the best way may depend on just how your script is
>>>> > written. I am assuming it is PHP and is running on either a remote host
>>>> > or your localhost Apache server or equivalent.
>>>>
>>>> You will need shell access to run a cron locally on the host. If that is
>>>> not an option, you can use a cron on another *nix box to hit a script
>>>> that will send 200 messages.
>>>> lynx -dump /webserver/script.php is a good one.
>>>>
>>>
>>> No you don't. There are webmaster tools which allow you to set up cron
>>> jobs.
>>
>> This is true.
>>
>>>
>>>> This can also be done from a remote windows box as well using scheduled
>>>> tasks.
>>>>
>>>
>>> Oh gawd - why would you EVER want to do that?
>>
>> Despirate times call for despirate measures.
>>
>
> And what happens if your windows box gets shut off? Or the link fails? Or
> any of a bunch of other things that can happen?
>
> It's a terrible suggestion.
>

I use this trick for various things at work, and have never had a problem.
Not a terrible idea if you think about it.

>>>
>>>> I myself would just program the email script to send 200 messages / wait
>>>> for the duration of the hour, repeat until all messages are sent.
>>>>
>>>>
>>>
>>> And exactly how are you going to do that?
>>
>> It's fairly easy to time a script, and make it sleep for the difference.
>>
>
> And what happens when the script times out? Or it crashes? Or the server is
> rebooted? Or the host kills it because it's been running for so long? Or
> any of a hundred other things which can go wrong?
>
> Another bad suggestion, actually.
>

Cheesit's Rice Man. Get in the game here. One can modify the php.ini
(max_execution_time) to be 61 minutes. If access to modify php.ini in not
available one can change this in the script itself using the ini_set
option so it will not time out.
Crashes? Then this guy should find a new host. As for the reboot. Who
cares. If this is setup properly, it will run again at the desired time
(post reboot) and process the remaining pending messages. It's not a bad
idea.



>>>
>>>>
>>>> >
>>>> > Since I am using a Win7 machine, which may go to sleep or shut down
>>>> > once
>>>> > in a while, it would make better sense to run whatever scheduling
>>>> > application on the remote server.
>>>>
>>>> So why not tell your 7 box to never go to sleep?
>>>>
>>>
>>> Exactly.
>>>
>>>> > And in that case, of course, the
>>>> > address list and the content would need to be there as well,
>>>> > probably in
>>>> > a MySQL or similar database. I found the following that may help:
>>>> > http://www.phpjobscheduler.co.uk/
>>>> >
>>>> > Otherwise, there may be some free email servers that permit mass
>>>> > mailings, and if not, there are some that seem to be inexpensive. Here
>>>> > are some reviews:
>>>> > http://email.about.com/od/freeemailreviews/tp/free_email.htm
>>>> >
>>>> > Paul
>>>>
>>>> Do a google search for "unlimited smtp access". Find a cheap one, and be
>>>> done with it.
>>>>
>>>
>>> A very good suggestion.
>>>
>>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: Firefox PHP error report
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 22:55:49 GMT 2024

Total time taken to generate the page: 0.03991 seconds