Question: Logparser to search recursively for any file >200k
Question:
Sender: Simon Bell
IP Address: 141.165.xx.xx
=====================================
I'd like to user logparser to search recursively from a starting directory for all files greater than 200k. Then save the file name, path and date to an html file. I've see where users have used the Top 10 command which I can replicate, but I'm having difficulty doing a search that lists the files if file > 200k.
Thanks in advance,
Simon
Answer:
What particular difficulty you facing? Well, I modified one of my sample script to the following:
--FileSize200.sql
SELECT
EXTRACT_PATH(TO_LOWERCASE(path)) AS ContentPath,
TO_LOWERCASE(name) AS FileName,
DIV(size,1024) AS FileSize(K)
FROM %source%
WHERE TO_INT(FileSize(K)) > 200
--FileSize200.sql
Then run it at command line as:
LogParser.exe file:filesize.sql?="c:\inetpub\*.*" -i:FS
And I got the output of:
ContentPath FileName FileSize(K)
-------------------------------------- ----------- -----------
c:\inetpub\iissamples\sdk\asp\database authors.mdb 332
<shamlessplug>
I contributed two chapters in the one and only Log Parser book :)
</shamelessplug>