CyberNerd Posted June 22, 2012 Posted June 22, 2012 What's the windows equivalent of lsof please? I want to know what process is using a particular file.
Geoff Posted June 22, 2012 Posted June 22, 2012 Noting in the stock OS will do it. Try this though. Process Explorer 1
glennda Posted June 22, 2012 Posted June 22, 2012 Depends what file your trying to view - in windows you can use share and storage manager to view which user has files open on a share. 1
Geoff Posted June 22, 2012 Posted June 22, 2012 True, but that doesn't give you the same information lsof does on *nix. Process Explorer does.
glennda Posted June 22, 2012 Posted June 22, 2012 True, but that doesn't give you the same information lsof does on *nix. Process Explorer does. But if you are trying to locate which user has kept a file open from a shared drive share and storage manager is the ticket. I agree Process explorer will tell you a lot more info but for basic easy access the other thing works!
CyberNerd Posted June 22, 2012 Author Posted June 22, 2012 Thanks. I used intuition in the end. The problem was with a custom app and it was actually IIS holding a log file open.. Don't suppose windows servers have anything as advanced as logrotate do they?
ChrisMiles Posted June 22, 2012 Posted June 22, 2012 Thanks. I used intuition in the end. The problem was with a custom app and it was actually IIS holding a log file open.. Don't suppose windows servers have anything as advanced as logrotate do they? /sarcasm? No it doesnt, because Windows services are supposed to use the Windows Event Log to log day-to-day activity not flat text files. Generally a windows installer will write to a log file as a one off and most services use the event log. There are always exceptions, but thats the fault of the service, not Windows.
CyberNerd Posted June 22, 2012 Author Posted June 22, 2012 /sarcasm? No it doesnt, because Windows services are supposed to use the Windows Event Log to log day-to-day activity not flat text files. Generally a windows installer will write to a log file as a one off and most services use the event log. There are always exceptions, but thats the fault of the service, not Windows. I suppose windows applications aren't supposed to use text files for configuring either. This app uses XML files for configuration and 'standard' log files for logging. Somehow it also requires IIS. without sed, grep and a decent test editor this is taking me 10 times longer than it should! I don't know how you windows admins put up with this O/S Linux is SO much easier !
glennda Posted June 22, 2012 Posted June 22, 2012 /sarcasm? No it doesnt, because Windows services are supposed to use the Windows Event Log to log day-to-day activity not flat text files. Generally a windows installer will write to a log file as a one off and most services use the event log. There are always exceptions, but thats the fault of the service, not Windows. Pretty sure IIS logs to C:\windows\system32\logfiles\W3SVC1 does it not? therefore microsoft don't follow there own principles! they do however create a new file for each day.
Geoff Posted June 22, 2012 Posted June 22, 2012 (edited) IIS logs flat files in 'C:\Windows\System32\LogFiles\W3SVC1' IIRC. I'd just use Cygwin tbh. However I did come across this script too. http://www.sapien.com/forums/scriptinganswers/forum_posts.asp?TID=1650 Edited June 22, 2012 by Geoff
CyberNerd Posted June 22, 2012 Author Posted June 22, 2012 it isn't an IIS log. the log is from a 3rd party app, but since I couldn't lsof to find the process I shut down the whole of IIS.
psydii Posted June 22, 2012 Posted June 22, 2012 Might LogParser be able to help? Log Parser 2.2 Also powershell can do regex though that is something I've never quite got the hang of. /hands in his sysadmin card. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now