Rather than having the program doing nothing, then waking up twice a day, write a seperate program that perforns the task you're interested in and schedule it to run twice a day.
1. You won't have to worry if it's running or not.
2. It won't consume system resources until it needs to collect stats.
3. You can "upgrade" your program more easily in a production environment.
4. You don't need to worry about resource leaks in a long running program.
5. It's the standard thing to do.
thanks kbw, I was reading about it, but it has a problem if I need a binary with parameters it won't work, me thinks.
The rusty solution I found is to have a text file that could be read by the binary/script in order to get these parameters
In fact I need to read several registers from a MySQL table, but as I understood I can set binary files with cron/crontab as well.
I appreciate any suggestion anyway.
Thanks a lot, regards