how can i run php script in background?

i dont find how to run every 2 second the script

just every 1 min... in cron.
 
Cron only operates at one-minute intervals. While you could probably write a system-olevel program to run cronjobs every two secons, it might put too much of a load on the server, depending on exactly what is in the cronjob.

Jeff
 
Good catch, scsi, but I did find this in the documentation:
[1] Note that while commands can be scheduled to run at any second, it is unlikely that they will be executed then but some time shortly thereafter, depending on the load on the system and the number of jobs that mcron has to start at the same time.
And in reading the page carefully, it appears that the second runs within the next minute; if that's so, then it can't be configured for every two seconds, except by setting up 30 separate cronjobs.

Jeff
 
Back
Top