How reload a php script every 1-5seconds in cron ? Would not it be better to use System_Daemon to reload the php script? I have Debian System.
1条回答 默认 最新
- dongtaijiao7140 2013-08-14 23:13关注
You can't really do this with cron, but instead you could write a script (either shell or php) that would loop forever and do something every X seconds.
-
In addition, make a crontab entry that would run every Y minutes and launch that script (if it's still not running). You can do the latter using a pid file that your script creates (read the pid and check if there is a process with that id).
This check can also be internal within the script - so that when the script is started more than once, it would check if another copy alrady running
解决 无用评论 打赏 举报