一個老舊的 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" );
________________
美術插畫設計案子報價系統 v0.1 Beta
爪哇禾雀
|