PHP: running scheduled jobs (cron jobs) -
i have site on webhotel run scheduled tasks on. methods of achieving recommend?
what i’ve thought out far having script included in top of every page , let script check whether it’s time run job or not.
this quick example of thinking about:
if ($alreadydone == 0 && time() > $timetorunmaintainance) { runtask(); $timetorunmaintainance = time() + $interval; } anything else should take consideration or there better method this?
that's cronjobs made for. man crontab assuming running linux server. if don't have shell access or no way setup cronjobs, there free services setup cronjobs on external servers , ping 1 of urls.
Comments
Post a Comment