首頁 繪圖設計 工作閒聊 比賽活動 美術討論 標籤 圖片
Apache httpd Log Rotate by Perl
Type(Type) 2006/12/23 20:29
一個老舊的 Perl - apache httpd Log Rotate 後台工具,
Windows/UNIX/LINUX 應該都可用。

代碼:

#!P:/Perl/bin/Perl.exe

($sec,$min,$hour,$mday,$mon,$year,$wday)=(localtime)[0,1,2,3,4,5,6];
$year += 1900;
$mon += 1;
$logg = $year."-".$mon."-".$mday.".log";
$errl = "error-".$logg;

print "Stopping APACHE2!".$/;
system( "P:\\Apache2\\bin\\apache -k stop" );

print "Renaming!...".$/;
system( "move P:\\Logs\\access.log P:\\Logs\\$logg" );
print "Renaming!...".$/;
system( "move P:\\Logs\\error.log P:\\Logs\\$errl" );

print "Restarting APACHE2!".$/;
system( "P:\\Apache2\\bin\\apache -k start" );



#apache
#httpd
#perl

#apache by Type
#httpd by Type
#perl by Type
(4,029 views)
[更多討論] 討論區 Windows, Linux, Perl, PHP, C/C++, Driver, Web 理論、應用、硬體、軟體

"Apache httpd Log Rotate by Perl" 傳統頁面(電腦版)

首頁 繪圖設計 工作閒聊 比賽活動 美術討論 標籤 圖片
傳統桌面版 [ 登入/註冊 ]
© Vovo2000.com Mobile Version 小哈手機版 2025