Check for newest file

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
thomas.mueller@envers.de
Posts: 34
Joined: Mon Oct 26, 2009 2:55 pm
Location: Duisburg, GERMANY

Check for newest file

Post by thomas.mueller@envers.de »

Hi,

I need to check a folder for the existance of a file. The file is generated each day and files older than 3 days will be deleted. I now need to asure that one of the three existing files (the newest one) is not older than 24 hours. Any hint how I can do that?

Thanks
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You need Folder/File Availability test with the following settings:
Translate macros: marked
File or Folder name: d:\TESTS\%NewestFile%
Alert when: file doesn't exist or older that 1440 min (1440 min = 24 hours)
Optionally, you may enable "Tune up Reply value" option and specify variables like the following:
%FileName% (%FileTime%)

Please check for details at:
http://www.ks-soft.net/hostmon.eng/mfra ... #fileexsts
http://www.ks-soft.net/hostmon.eng/mfra ... especmacro
thomas.mueller@envers.de
Posts: 34
Joined: Mon Oct 26, 2009 2:55 pm
Location: Duisburg, GERMANY

Post by thomas.mueller@envers.de »

That works fine so far. Thanks!

What can I do if there are 20 versions of a file in the directory and there are three different files? I still need to chek for the newset version but this time for all three file names.

Example:

file1_20160201.bak
file1_20160131.bak
file1_20160130.bak
...
file2_20160201.bak
file2_20160131.bak
file2_20160130.bak
...
file3_20160201.bak
file3_20160131.bak
file3_20160130.bak
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I think you need 20 Count Files tests
1)
File mask: file1_*.bak
Count files newer than 1440 min
Alert when folder contains more than 0 files
Reverse alert: enabled

2)
for 2nd test, use filemask for 2nd set of files
File mask: file2_*.bak
Count files newer than 1440 min
Alert when folder contains more than 0 files
Reverse alert: enabled

and so on

Regards
Alex
thomas.mueller@envers.de
Posts: 34
Joined: Mon Oct 26, 2009 2:55 pm
Location: Duisburg, GERMANY

Post by thomas.mueller@envers.de »

Great!

Never clicked the drop-down-box in the count files-test!
New possibilities.... :-D
Post Reply