IIS Logs - A script to decompress 1000's easily.
Published July 30th, 2008 in Scripts, Tips and TricksI needed a way to decompress a folder of gzipped IIS logs so that I may run Microsoft Log Parser against them. Instead of using Windows Explorer to select all the files and put into memory to attempt to extract, it is more feasable to run a command line script to select each file one by one, extract it, and then go to the next file. To do this, requires a command line decompressor. The best freeware product on the market is 7zip's 7za. Here is the script I used to extract the folder, recording the date and time that the process bagan and ended.
echo Backup Started on date time %date:~4,2%_%date:~7,2%_%date:~10,4% %time% >> decompressGZ_%date:~4,2%_%date:~7,2%_%date:~10,4%.txt
for %%i in ("*.gz") do 7za.exe e "%%i" -y >> decompressGZ_%date:~4,2%_%date:~7,2%_%date:~10,4%.txt
echo Backup Completed on date time %date:~4,2%_%date:~7,2%_%date:~10,4% %time% >> decompressGZ_%date:~4,2%_%date:~7,2%_%date:~10,4%.txt
Print This Post
Email This Post
Related Articles
- Automatic JBoss log compression using Linux
- Perl Script to Backup and Clear EventLogs
- Compress multiple folders into individual archives
- Log Parse in Windows without Log Parser
- Create a Bootable Windows XP SP3 Integrated with Post-SP3 fixes CD

