php proxy.php proxy.conf
這次主要是在 proxy.php 增加備份檔案設定
內容如下
date_default_timezone_set('UTC');
$bak_file=$_SERVER['argv'][1].'.bak_'.date("Ymd");
if(file_exists($bak_file)){
$flag=0;
$n=1;
while(1==1){
$bak_file1=$_SERVER['argv'][1].'.bak_'.date("Ymd").'_'.$n;
echo "預設備份檔名 ".$bak_file." 有重複,重新命名為 ".$bak_file1."\n";
if(file_exists($bak_file1)){
$n++;
}
else{
$bak_file=$bak_file1;
break;
}
}
}
else{
echo "預設備份檔名 ".$bak_file."\n";
}
$cmd = 'cp '.$_SERVER['argv'][1].' '.$bak_file;
exec($cmd);
?>
0 意見:
張貼留言