Solved

monitoring a folder / file size

Posted on 2004-10-07
6
200 Views
Last Modified: 2010-04-14
I would like to set up a monitoring of a folder which contains two files, once they get to a certain size collectively I would like to be notified. Is there anything native to windows 2003 that can do this?

I do not want set up quotas.
0
Comment
Question by:Microtech
6 Comments
 
LVL 4

Expert Comment

by:shard26
ID: 12251986
That seems like a perfect situation for quotas. Why don't you want to use'em?

0
 
LVL 17

Author Comment

by:Microtech
ID: 12252041
it is the exchange database I want to monitor, as soon as it gets above 15gb I need to be notified, quotas will not work on this. Sorry, I was just wondering if there was a native tool ... http://www.experts-exchange.com/Networking/Email_Groupware/Exchange_Server/Q_21149273.html 
0
 
LVL 10

Accepted Solution

by:
Longbow earned 100 total points
ID: 12252511
''--- FileSize Script ---
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim fso, f, s
   filespec = "c:\test.txt"
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFile(filespec)
   s = UCase(f.Name) & " uses " & f.size & " bytes."
   ShowFolderSize = s
   msgbox ShowFolderSize
   if f.size >= 1000 Then msgbox "Size exceeded !"
   if f.size >= 1000 Then wshshell.run ("net send xxx " & "Size exceeded !")
'--- End of script ---

Save the above in a .vbs file.

It will check the size of c:\test.txt
When the file reaches 1000 bytes a message will be sent to a computer with the "net send" comand.

I can modify the script so it will run all the day, waiting for the condition.
Actually it can be run from a logon script and alert you if the size is 1000 bytes or more.
15 Gb is 16106127360 bytes.
The msgbox command displays the message on the computer where the script is running.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 25 total points
ID: 12255606
If the mail database is on a drive by itself, or could be moved to a separate drive, then you could use Exchange's monitoring feature to send yourself an alert.  Or, if you have access to Visual Basic, then you could create a folder watching application.  Here's a link (http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20881770.html) to an EE question about folder watching that includes links to several examples.    Otherwise, Longbow's script seems like a good solution.
0
 
LVL 17

Author Comment

by:Microtech
ID: 12257029
thanks for your comments, I will investigate.
0
 
LVL 17

Author Comment

by:Microtech
ID: 12679942
sorry for the time it has taken.... this question will be finalized within the next week
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Read about why it is more lucrative for an IT company to participate in government projects.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question