Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check log file and notify if stopped

Status
Not open for further replies.

moogeboo

MIS
Aug 7, 2003
28
0
0
US
Hello everyone,

I have a logfile that is updated every 5 minutes. What I'd like to do is have a vbscript monitor this file and if the last date modified is greater than 30 minutes from the current time, send an email to me.

Thanks!
Moogeboo
 
you will need to use the
LastDateModified property of the file.
you can get this by creating a ref to a file object.

If you stick with a simple vbscript which is always running you will need a nasty loop in it, something like

Do
Wscript.Sleep 60000
Wscript.Sleep 60000
Wscript.Sleep 60000
Wscript.Sleep 60000
Wscript.Sleep 60000
'im sure the 60000 is probably wrong
'5 mins has elapsed do the check
If DateDiff(n, aFile.DateLastModified, Now()) > 29 Then
'do something, send email?, write to eventlog?
End If
Loop
 
Thanks for the input!

I got it figured out now....

Moogeboo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top