KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Check for newest file

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
thomas.mueller@envers.de



Joined: 26 Oct 2009
Posts: 34
Location: Duisburg, GERMANY

PostPosted: Fri Jan 15, 2016 2:44 am    Post subject: Check for newest file Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Fri Jan 15, 2016 4:11 am    Post subject: Reply with quote

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/mframe.htm#tests.htm#fileexsts
http://www.ks-soft.net/hostmon.eng/mframe.htm#tests.htm#filespecmacro
Back to top
View user's profile Send private message Send e-mail Visit poster's website
thomas.mueller@envers.de



Joined: 26 Oct 2009
Posts: 34
Location: Duisburg, GERMANY

PostPosted: Fri Feb 12, 2016 1:39 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
KS-Soft



Joined: 03 Apr 2002
Posts: 12792
Location: USA

PostPosted: Fri Feb 12, 2016 7:46 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
thomas.mueller@envers.de



Joined: 26 Oct 2009
Posts: 34
Location: Duisburg, GERMANY

PostPosted: Fri Feb 12, 2016 8:57 am    Post subject: Reply with quote

Great!

Never clicked the drop-down-box in the count files-test!
New possibilities....
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index