i want to make a debian init.d daemon which runs a php script in shell but i want this to run infinitely without exploiting all the system resources. it basically checks a mysql db and with conditions make files in a temp directory.
first i made a cronjob which runs every minute but it's not enough for me because it must continously check db and if the conditions met it must create temp files in real-time.
in the below link i could make daemon sh script which runs my php file, but if i put my script in a do loop block cpu is getting %50 load.
hope i could explain my problem.