Hourly script [message #173298] |
Sat, 02 April 2011 17:38  |
Question Boy
Messages: 8 Registered: April 2011
Karma: 0
|
Junior Member |
|
|
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?
Any help would be truly appreciated.
QB
|
|
|
|
|
|
|
|
Re: Hourly script [message #173304 is a reply to message #173298] |
Sat, 02 April 2011 20:37   |
P E Schoen
Messages: 86 Registered: January 2011
Karma: 0
|
Member |
|
|
"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.
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. 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
|
|
|
Re: Hourly script [message #173306 is a reply to message #173304] |
Sat, 02 April 2011 22:18   |
Mr. B-o-B
Messages: 42 Registered: April 2011
Karma: 0
|
Member |
|
|
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.
This can also be done from a remote windows box as well using scheduled
tasks.
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.
>
> 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?
> 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.
|
|
|
|
|
Re: Hourly script [message #173310 is a reply to message #173304] |
Sun, 03 April 2011 00:06   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 4/2/2011 4:37 PM, P E Schoen wrote:
> "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.
>
Windows also has scheduled tasks. But since the vast majority of the
web servers use Linux, I recommended the Linux version.
> 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. 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/
>
Not if it's a web server it shouldn't!
> 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
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: Hourly script [message #173311 is a reply to message #173306] |
Sun, 03 April 2011 00:09   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
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 can also be done from a remote windows box as well using scheduled
> tasks.
>
Oh gawd - why would you EVER want to do that?
> 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?
>
>>
>> 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.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: Hourly script [message #173312 is a reply to message #173311] |
Sun, 03 April 2011 00:18   |
Mr. B-o-B
Messages: 42 Registered: April 2011
Karma: 0
|
Member |
|
|
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.
>
>> 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.
>
>>
>>>
>>> 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.
>
|
|
|
Re: Hourly script [message #173313 is a reply to message #173312] |
Sun, 03 April 2011 02:00   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
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 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.
>>
>>>
>>>>
>>>> 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.
>>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
|
|
|
|
Re: Hourly script [message #173327 is a reply to message #173313] |
Sun, 03 April 2011 14:22   |
Mr. B-o-B
Messages: 42 Registered: April 2011
Karma: 0
|
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.
>>>
>>
|
|
|
|
|
Re: Hourly script [message #173330 is a reply to message #173328] |
Sun, 03 April 2011 18:01   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 4/3/2011 11:12 AM, Mr. B-o-B wrote:
> Jerry Stuckle cried from the depths of the abyss...
>
>> On 4/3/2011 7:03 AM, Luuk wrote:
>>> On 03-04-2011 04:00, Jerry Stuckle wrote:
>>>> 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?
>>>
>>> The script that actually send a message (an email-message in this case)
>>> should of course mark the message a being send.
>>>
>>> A restart of the script should skipp all messages that already have been
>>> send...
>>>
>>>
>>>
>>
>> And how is it to know? How is it going to keep track of messages?
>
> This is not at all a problem. Assuming the OP has access to mysql(or
> another sql db), or at least the ability to create a table in the db
> then the script should create a temp table to store all the message that
> need to be sent. One of the keys should be something like
> "message_sent". When the script re-runs it should check for the temp
> table, if it exists continue with message sending otherwise (new batch
> of messages ) create a new temp table & populate with the message list.
>
> Then in a nutshell the script will query the temp table
> "SELECT * FROM temp WHERE message_sent <> 'yes'";
>
> Start iteration on the above results.
> After each message is send, update the message record to message_sent =
> 'yes' or however you want to mark it as flagged.
>
> At the start of the script note the time of the script start. Calculate
> endtime +59 minutes from start time. Also set a $messages_sent var to 0.
> Each message should ++ this var. Each iteration should check the time
> first not to exceed 60 minutes or 200 messages sent.
>
> if ($end_time >= $right_now_loop_time || $messages_sent <= 200) {
> proceed to send messages
> $messages_sent++
> update table query to mark message as sent
> }
> else{
> exit(0)
> }
>
> You should also incorporate a nrow check on the table into the script.
> Once the last stored record(message) is processed(sent) the temp table
> should be dropped & exit the script.
>
> This entire process can of course be done using a file to store the
> messages on the localfile system as well (if db not available).
>
>
>> Yes, there are ways - but the op mentioned nothing about these. And if
>> the script is killed, potentially hundreds of messages could go unsent.
>
> Negative. It's not rocket science. This is not really a problem if one
> takes 25 seconds to think it over. Unfortunately you only gave it a
> couple seconds before you decided that the very easy is impossible.
>
>
>
>
>
I didn't say it couldn't be done. However, it's something which has to
be considered, and for a relatively new programmer, is not at all obvious.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: Hourly script [message #173331 is a reply to message #173327] |
Sun, 03 April 2011 18:09   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 4/3/2011 10:22 AM, Mr. B-o-B wrote:
> 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 had a client who had a forum which sent emails based on cron jobs.
They moved to a host which didn't allow cron jobs and tried your
suggestion. Too many messages got delayed for too long - for instance,
a thunderstorm knocked out power to their office on a Friday evening.
No one was in there to restart the system making the calls until Monday
morning. Meanwhile, all kinds of messages got lost.
It's not bad if you want to do stats; miss a day and it will still
recover the next day. But people who want *reliable* results know
better. And if you don't care about that, why not just host from your
house? It's much cheaper.
>>>>
>>>> > 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.
>
I am in the game here. First of all, you cannot modify php.ini unless
you have access to the system - in which case you will have no problem
setting up a cron job. And many (most?) shared hosts do not allow the
max_execution_time to be overridden - for very good reason (reliable
hosts won't, at least).
As for crashes - all kinds of things can happen. The script itself can
crash; systems do get rebooted. And how are you going to restart the
script without access to the system?
You show an amazing lack of practical knowledge of how hosting works.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: Hourly script [message #173332 is a reply to message #173331] |
Sun, 03 April 2011 19:23   |
Mr. B-o-B
Messages: 42 Registered: April 2011
Karma: 0
|
Member |
|
|
Jerry Stuckle cried from the depths of the abyss...
> On 4/3/2011 10:22 AM, Mr. B-o-B wrote:
>> 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 had a client who had a forum which sent emails based on cron jobs. They
> moved to a host which didn't allow cron jobs and tried your suggestion. Too
> many messages got delayed for too long - for instance, a thunderstorm knocked
> out power to their office on a Friday evening. No one was in there to restart
> the system making the calls until Monday morning. Meanwhile, all kinds of
> messages got lost.
>
> It's not bad if you want to do stats; miss a day and it will still recover
> the next day. But people who want *reliable* results know better. And if
> you don't care about that, why not just host from your house? It's much
> cheaper.
Perhaps you failed your client by not suggesting a proper UPS, and a
network monitoring system to notify them that the server was done so it
wouldn't have to wait until Monday.
What is their #, I could use the business.
>
>>>> >
>>>> >> 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.
>>
>
> I am in the game here. First of all, you cannot modify php.ini unless you
> have access to the system - in which case you will have no problem setting up
> a cron job. And many (most?) shared hosts do not allow the
> max_execution_time to be overridden - for very good reason (reliable hosts
> won't, at least).
>
Fair enough.
> As for crashes - all kinds of things can happen. The script itself can
> crash; systems do get rebooted. And how are you going to restart the script
> without access to the system?
>
> You show an amazing lack of practical knowledge of how hosting works.
>
I do? I thought I made it clear that a crash, or reboot wouldn't matter
if the script is getting hit hourly.
|
|
|
Re: Hourly script [message #173333 is a reply to message #173332] |
Sun, 03 April 2011 20:04   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 4/3/2011 3:23 PM, Mr. B-o-B wrote:
> Jerry Stuckle cried from the depths of the abyss...
>
>> On 4/3/2011 10:22 AM, Mr. B-o-B wrote:
>>> 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 had a client who had a forum which sent emails based on cron jobs.
>> They moved to a host which didn't allow cron jobs and tried your
>> suggestion. Too many messages got delayed for too long - for instance,
>> a thunderstorm knocked out power to their office on a Friday evening.
>> No one was in there to restart the system making the calls until
>> Monday morning. Meanwhile, all kinds of messages got lost.
>>
>> It's not bad if you want to do stats; miss a day and it will still
>> recover the next day. But people who want *reliable* results know
>> better. And if you don't care about that, why not just host from your
>> house? It's much cheaper.
>
> Perhaps you failed your client by not suggesting a proper UPS, and a
> network monitoring system to notify them that the server was done so it
> wouldn't have to wait until Monday.
>
> What is their #, I could use the business.
>
Please tell me how a UPS is going to protect against a 6 hour outage.
And adding a networking monitoring system would cost money - it would be
cheaper to go to a good hosting company which does support cron jobs -
which they did.
And even if they did have a network monitoring system, no one was going
to go into the office on the weekend just to power up a machine anyway.
>>
>>>> >>
>>>> >>> 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.
>>>
>>
>> I am in the game here. First of all, you cannot modify php.ini unless
>> you have access to the system - in which case you will have no problem
>> setting up a cron job. And many (most?) shared hosts do not allow the
>> max_execution_time to be overridden - for very good reason (reliable
>> hosts won't, at least).
>>
>
> Fair enough.
>
>> As for crashes - all kinds of things can happen. The script itself can
>> crash; systems do get rebooted. And how are you going to restart the
>> script without access to the system?
>>
>> You show an amazing lack of practical knowledge of how hosting works.
>>
>
> I do? I thought I made it clear that a crash, or reboot wouldn't matter
> if the script is getting hit hourly.
>
>
>
>
Yes, you do.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
|
|
|
|
|
|
Re: Hourly script [message #173342 is a reply to message #173338] |
Mon, 04 April 2011 01:51   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 4/3/2011 8:56 PM, Mr. B-o-B wrote:
> On 4/3/2011 7:50 PM, Jerry Stuckle cried from the depths of the abyss:
>> On 4/3/2011 7:59 PM, Mr. B-o-B wrote:
>>> On 4/3/2011 3:04 PM, Jerry Stuckle cried from the depths of the abyss:
>>>
>>>> >
>>>> > I do? I thought I made it clear that a crash, or reboot wouldn't
>>>> > matter
>>>> > if the script is getting hit hourly.
>>>>
>>>> Yes, you do.
>>>>
>>>
>>> At the end of the day it does not matter what you think negative Nancy.
>>
>> Oh, and BTW - I see you have no intelligent response, so you have to
>> resort to third-grade name calling.
>>
>> How mature. NOT!
>>
>
> It's just the truth.
Yea, just like all trolls. Run out of logical arguments, so you have to
start calling people names, just like a third grader. Then claim "it's
the truth".
ROFLMAO!
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: Hourly script [message #173351 is a reply to message #173308] |
Mon, 04 April 2011 13:43  |
Captain Paralytic
Messages: 204 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Apr 3, 12:56 am, Question Boy <question....@hotmail.com> wrote:
> On Apr 2, 7:18 pm, Jim Higgins <inva...@invalid.invalid> wrote:
>
>> On Sat, 2 Apr 2011 10:38:48 -0700 (PDT), Question Boy
>
>> <question....@hotmail.com> wrote:
>>> 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?
>
>>> Any help would be truly appreciated.
>
>> If I were you I'd give priority to getting the 200 emails per hour
>> limit lifted.
>
> The host will not change this and I have been unable to convince the
> charity to move to another host. So it looks like I will seriously
> look into one of the other proposed solutions.
>
> Thank you all for the advice!
>
> QB
What's wrong with Mr. B-O-B's suggestion of using an unlimited SMTP
server or even sending through MailChimp.
|
|
|