|
Answer» I need a script that will search folder + subdirs for the existance of 2 files that don't match but contain information that pertain to a certain item, and if it finds 1 but not the other it will do something such as log that it's missing to another file, or email me. Here is an example of what I mean.
We have a folder called x:\bkgate\node then under each one of these is a folder for a different location such as PZ04060\reports, and in each one of these FOLDERS are files called reg1.ini through reg12.ini, and also files called ClamScanLog_PZ04060_REG1.txt, ClamScanLog_PZ04060_REG2.txt and so on. I need something that will look for all these files and if it files for example a x:\bkgate\node\pz04060\reports\reg4.ini but it doesn't have a matching ClamScanLog_PZ04060_reg4.ini it will then put an alert such as "4060 reg4 missing clamscan log" into a log file that we can check daily. I have made quite a few batch scripts that do some pretty cool things but this one I have no clue how to begin, any ideas?You are GOING to want to run embedded for commands to do the searching you are looking for and also USE the delims to differentiate the files. It's more DETAIL work than anything, but if I get a chance, I'll see if I can put together something for you to use.So you have a folder structure like this.
x:\bkgate\node\PZ04060\reports x:\bkgate\node\PZ04061\reports x:\bkgate\node\PZ04062\reports
We are always looking at the FOLDERS that start with PZ?
Should be able to do this with two Two FOR Loops. One nested inside the other.
|