On 2/9/07, Mathew <[EMAIL PROTECTED]> wrote:

I'm running this as a cron job 1 minute after midnight on Saturday
nights (Sunday morning) so as to cover all of Saturday back through the
previous Sunday.  Does your suggestion mean I'd have to run it late
Sunday night in order for it to cover Saturday back to the previous
Sunday (since the timestamp would be 24 hours ago)?

The idea is to run it sometime in the first hour (or so) of the day on
Sunday. (Lots of cron tasks get scheduled for that first minute of the
day or week; it's probably more reliable to run it a few minutes
later.) When it runs, it needs to determine the previous day's date
(right?). It can do that by giving localtime an adjusted time value,
instead of the current time.

I'm also guessing that this corrects the problem I mentioned regarding
skipping the 31st of Jan which was in the middle of the week.  Is that a
good assumption?

Well, that problem came from your own date-handling code (yes?); if
you use Perl's code (i.e., the localtime function), you shouldn't have
those kinds of bugs. Unless I've misunderstood you.

Good luck with it!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to