I have a cronjob which runs PHP on a wordpress cron.php file. Its mainly used to schedule post and I believe it may refresh cache.
I run the cron job every minute. I checked out the ps often and I see TWO PHP instance running cron.php. Now this is unnecessary because running one instance will do everything it needs to. I have another job which checks for ram and sometimes two instance trip it off (I expect a high amount of ram available at all times, I can lower it but I don't want to). I hardly believe one job can take more than a minute (although it may).
How do I run a job but not if the process exist already? I don't think the PHP code itself can check unless it connects/uses the db? Is there a cron command I may use? I don't want to kill an instance if its >1minute. Just not spawn new ones.