I need to generate some charts and reports, but only when my DB is modified. Because the time needed to generate the reports varies between 2 and 4 seconds and the number of reports varies too I'm thinking to use a cron which checks for DB modifications. The thing is that I don't wish to start generating another report, while other is running. In other words I don't wish to start another process while the previous one is still running. How can I accomplish this?
my cron look like this:
*/1 * * * * php /home/john/public_html/reportsGeneratorByCron.php