Description
Archive and pack IIS log files.
Source Code
$WinRar = "C:\Program Files\WinRAR\rar"
$TodaysLogFile = get-date -Uformat %y%m%d
$TodaysLogFile = "ex$TodaysLogFile.log"
$LogFiles = ls *.log
if ($LogFiles) {
foreach ($File in $LogFiles) {
$FileName = $File.Name
if ($FileName -ne $TodaysLogFile) {
echo "Compressing $FileName"
&$WinRar m "$FileName.rar" $FileName
}
}
}
Source Code and Samples
Wednesday, 14 February 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment