I am trying to find a list of different approaches for running scheduled tasks in PHP. My intention is to provide a universal way to run scheduled tasks in PHP. So far, I:
1) Analysis of site traffic. If you receive 770 hits per day (this is one hit in 2 minutes), and you scheduled a task to start at 6:00 in the morning, and the visitor requested the page at 5:59 in the morning, then run the task because the next visitor will arrive on average at 6:01 a.m. Run = exec ('/ usr / bin / php -f / home / account / cron.php') in this case.
(+) Works on all platforms as long as the paths are correct.
(-) Some processor power is required.
(-) Requires exec ().
(-) Inaccurate on small sites or on sites with huge traffic traffic.
2) Improved version above. When a user requests a page and the task is intended to run, do not use exec (), but include () after you reset the contents of the user.
(+) Works on all platforms.
(+) No exec ().
(-) Some processor power is required.
(-) Inaccurate on small sites or on sites with huge traffic traffic.
3) , . , "" "" "". fsockopen() .php script, . sleep(), , (.: time_sleep_until()). , , . "run-daily-3.00am", .
(+) .
(+) exec().
(+) (, ).
(-) - .
(-) , 24/7/365 = hog?
4) exec ('crontab') Linux .
(+) .
(+) .
(-) exec().
(-) .
5) cPanel POST // .
(+)
(+) .
(-)
(-) =
(-) ( cPanel, Windows).
(-) cPanel.
?