File System monitoring
Created: 06 Mar 2013 | 2 comments
Can we monitor file system(file count in a folder/looking for content in file/file modified date/etc) using Altiris monitoring 7.1 SP2?
Operating Systems:
Discussion Filed Under:
Comments 2 Comments • Jump to latest comment
You can create a new policy and a new metric using command. You will use the ForFiles command.
Example: To delete files older than (for example) two days:
Forfiles /P C:\Downloads\ /S /M *.jpg /D -2 /C "cmd /C del /Q @path"
Here are a couple more examples.
Using forfiles command we can get modified date and time for all the files in a directory.
forfiles /C "cmd /c echo @file @fdate @ftime"
We can restrict the command only to certain files using * command. For example, to get modified time/date only for pdf files, we can use the below command.
forfiles /M *.pdf /C "cmd /c echo @file @fdate @ftime"
Would you like to reply?
Login or Register to post your comment.