File "update_chaeck.php"

Full path: /www/upfile/SEADOM7/update_chaeck.php
File size: 657 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Back

<?php
$updatetime = file_get_contents("/www/upfile/updatetime.txt");
$update_ = filemtime("/www/upfile/udp.php");

if($updatetime != $update_)
{
	$fp = fopen("/www/upfile/updatetime.txt","w");
	fwrite($fp,$update_);
	fclose($fp);

	$cmd = "ps -e -o pid,cmd | grep udp.php | grep -v grep | awk '{print $1}'";
	$pid  = "";
	exec($cmd,$pid);

	//プロセスを終了
	$kill_cmd = "kill " .$pid[0];
	exec($kill_cmd);

	//再起動
	$start_cmd = "nohup php /www/upfile/udp.php < /dev/null > batchout.log 2> batcherr.log &";
	exec($start_cmd);

}
	$fp2 = fopen("/www/upfile/cron_check.txt","w");
	fwrite($fp2,date("Y-m-d H:i:s",time()) ."\n");
	fclose($fp2);

?>

PHP File Manager