Quote:
Originally Posted by nhawk
If you have the task set up to run once a week on a given day and time, once the scheduled task runs it will automatically update itself to run the next week on the same day and time. There's no need to update the schedule manually in your code.
If you run the task manually, it does not affect the next scheduled run day/time.
|
Thanks for your reply nhawk. I realize that the cron task updates itself but my question is if I wanted to call that field (nextrun) from within the cron that's being executed to use as a time to set an "event" will tha time still be the current one or the next already? Basically I want to use the value of the field "nextrun" to create an event on the calendar. This event will be created within the cron thats being run, so my quesiton is If I call the field "nextrun" from within the file that's being executed by the cron will the time have already been updated for the next run? Basically asking does the "nextrun" field update before the task runs, as the task runs or after the task runs.
Another solution to this would be just to use this to set the next event (same time as "nextrun")
PHP Code:
$aotw_next_time = time() + 604800;
(604800 being a week in unix time). Although to be more exact and make sure that both values will be exactly the same ti would be better to use "nextrun" value, I'm not sure if time() will be the same every time (server might stall or something for a second). Any ideas?