Still loading
logo
logo
logo
logo
logo
logo
logo
logo
logo
logo
logo

PID file check script in PHP


Advertisement
PID file check script in PHP This script check for PID file creation time, and end the script in case it is newer than Xtime seconds. It is useful for running cron jobs and detection, whether the script should be running twice (check if it is still running).

Sign up


By registering I agree with your terms

400 tracked servers
576,000 pings / day
51 server outages today

PID file check script in PHP

This script check for PID file creation time, and end the script in case it is newer than Xtime seconds. It is useful for running cron jobs and detection, whether the script should be running twice (check if it is still running).

function pidder($pid,$xtime=600) {
    $time=mktime()-filectime($pid);
    if ((! is_file($pid)) || (isset($_GET["new"]))) {
        $fp=fopen($pid,"w");
        fputs($fp,date("Y-m-d H:i:s"));
        fclose($fp);
    } else if ($time>$xtime) {
        $fp=fopen($pid,"w");
        fputs($fp,date("Y-m-d H:i:s"));
        fclose($fp);
    } else {
        if (!isset($_GET["no"])) {
            Log::file("cron"," GORYCHLIK NO PID $time");
            die("PID $time");
        }
    }
}



From Our Blog

  1. Cloud server hosting (5 months ago)
  2. Up/Down test (3 months ago)
  3. Web hosting plans (2 months ago)
  4. Web Hosting Company Directory (2 months ago)
  5. Resize large images on Linux (1 months ago)
  6. PID file check script in PHP (1 months ago)
  7. What is SolarEdge monitoring (1 months ago)
  8. XBOX ONE - Streaming to Windows 10 (1 months ago)
  9. 6 Plugins for Import - Exporting Products from WooCommerce (1 months ago)
  10. 10 signs of good web hosting company (1 months ago)
  11. SSL certificates - why to invest with a Certificate Authority (1 months ago)
  12. AWS Lightsail review (1 months ago)
  13. Browser cookies - what is good for? (0 months ago)
  14. What is traceroute good for? (0 months ago)
  15. 3 Tools to Test Your Server's Security (0 months ago)
  16. International Web Hosts That Provide the Best UX (0 months ago)
  17. Benefits of Using an SSL Certificate for your Website (0 months ago)
  18. Pros and cons of free SSL certificate (10 days ago)

Free variant

Free

  • Personal usage
  • 1 website
  • 10 minutes interval

Basic variant

JPY 1,572 / Mo

  • Pro's
  • Up to 100 websites
  • 1 minute interval

Unlimited variant

JPY 9,037 / Mo

  • Pro's
  • Up to 1000 websites
  • 10 seconds interval

Sign up


By registering I agree with your terms


↑ Scroll Up ↑