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
Check for newest file
-
- Posts: 34
- Joined: Mon Oct 26, 2009 2:55 pm
- Location: Duisburg, GERMANY
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
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
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
-
- Posts: 34
- Joined: Mon Oct 26, 2009 2:55 pm
- Location: Duisburg, GERMANY
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
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
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
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
-
- Posts: 34
- Joined: Mon Oct 26, 2009 2:55 pm
- Location: Duisburg, GERMANY