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 (4 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. Proč se v USA hledá „facebook iniciar sesion“? (1 months ago)
  11. Looking for facebook initiar sesion (1 months ago)
  12. The end of 32 bits: support for old architecture on Linux is ending (1 months ago)
  13. Security perceptions: the ATM opens the gates (1 months ago)
  14. How to work with mobile targeting on PPC Facebook ads? (1 months ago)
  15. WWW and its capabilities (1 months ago)
  16. Ten of the best games for Linux for the past 10 years. (1 months ago)
  17. Does your facebook profile repel your customers? (1 months ago)

Free variant

Free

  • Personal usage
  • 1 website
  • 10 minutes interval

Basic variant

JPY 1,569 / Mo

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

Unlimited variant

JPY 9,020 / Mo

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

Sign up


By registering I agree with your terms


↑ Scroll Up ↑