in reply to Running a script daily

I agree with what some of the others are suggesting. First, write the script that does the work you want without worrying about the scheduling part. Then after getting that running correctly, use your OS's scheduler (cron in *nix, Task Scheduler in Windows) to run the task every day at midnight.

(If you're like me and not very familiar with cron, it looks like jethro gave you some tips on how work with cron.)

Replies are listed 'Best First'.
Re^2: Running a script daily
by Marshall (Canon) on Aug 20, 2010 at 02:27 UTC
    Agree with all the above postings. My additional thought would be to stay away from any boundary condition that might either be confusing or potentially produce erroneous results.

    The date changes at 00:00:00 (midnight), but sometimes 24:00:00 is used to mean the same time but with the date before. A time like 2:00 AM local can be trouble too as 2 AM can occur twice when this daylight savings time "go backwards" stuff happens. I often pick a number like 3:19 AM or 4:43 AM for these chron or task scheduler jobs for the simple reason of avoiding these issues.