I have two phps that do separate tasks and are executed using cronjobs. One executes every 5 mins and the other every 2 months. I want to make sure that when the 2 month php starts executing, the 5 min php isn't executing.
I want something like this,
PHP 1:
function execute1()
{
//set value of static variable
//do job
//unset value of static variable
}
PHP 2:
function execute2()
{
//This is the part where I need help
if (static_variable is set) //keep on waiting til value is unset
{
//do job
}
}
Should I use semaphores?