欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

nohup

程序员文章站 2022-03-19 23:37:15
...
<?php
$pid = getmypid();

$processNum = $argv[1];

$pidPath = dirname(__FILE__)."/../tmp/run_cli_airasia_checkpnr/";
$runPath = dirname(__FILE__)."/../webroot/";
$runCmd = "nohup ../sh/keep.sh 1 log/keep_cli_airasia_checkpnr_$pid.log cli_airasia_checkpnr_$pid.stop php index.php cli Cli_Airasia checkpnr >> ${pidPath}${pid}.out &";

if (!file_exists($pidPath)) {
    mkdir($pidPath);
}

file_put_contents("${pidPath}${pid}.run", "$processNum,$pid");

chdir($runPath);

for ($i = 0; $i < $processNum; $i++) {
    echo "$runCmd\n";
    system($runCmd);
    sleep(1);
}

application  sh  tmp  webroot

cd sh && php run_cli_airasia_checkpnr.php 1

相关标签: nohup