DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Program to Monitor Size of Specific Directories?  (Read 7,614 times)

ragnar01

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 6
Program to Monitor Size of Specific Directories?
« on: August 08, 2006, 01:29 AM »
I'm looking for a program/utility/widget that monitors the size of a (number of) directories and notifies the user when a preset size limit is reached. I can't believe noone has come up with something like this (ot more to the point, I can believe that I just haven't put in the right search terms so far).

Need/Concept is as follows:

I have a couple of unsophisticated users that have automatic or semi-automatic backup procedures enabled. The backup program writes zip files to a number of directories that I would like to have the users burn to CD or DVD when there is a reasonable amt of data to burn. What I would like to find is a program that runs in the background and monitors 1-5 directories and checks their size against a specified size. If the directory reaches (say) 75% of specified size a warning would show up on the desktop (say a yellow flashing light), if the size is larger than the limit a red warning flashes.

There was a Yahoo widget program of a similar concept but the directories were hard coded, and size limits weren't changeable - it would be nice to be able to set specific locations and custom sizes.

Any one have any suggestions or solutions in mind?

ragnar01

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Program to Monitor Size of Specific Directories?
« Reply #1 on: August 08, 2006, 07:38 AM »
is this what you want? CheckQuota

Quote
CheckQuota is the professional monitor program for directories. It monitors directory size and sends alerts if a limit was exceeded.
But CheckQuota has much more features. So it can works like a real disk quota program. Real disk quota this means, it can lock directories the write access for specified user if a maximum usage limit was reached.



wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • Coding Snacks
Re: Program to Monitor Size of Specific Directories?
« Reply #2 on: August 08, 2006, 03:18 PM »
Here's a quick and dirty AHK script... It was more of a challenge for me to see if I can do it (and learn some functions). :)

No yellow/red desktop messages, but just messageboxes. Perhaps Skrommel or someone else will do something better. The idea sounds quite nice.


  • Download and extract the attachment
  • Download + install Autohotkey, then you can start the script
  • Edit the ini file. Edit the example entries and add as many folders you want. Restart the script if you changed the ini.
  • Edit the ahk file in Notepad to set the timer and change the text messages.

FWIW, here's the code for people who don't want to download the attachment:
Spoiler (click to show/hide)

;#NoTrayIcon
#SingleInstance force
#Persistent
SetFormat,float,0.0


; ################ Interval to check folders in miliseconds
; ################ (3600000 = 1 hour)

SetTimer,FolderLimit,3600000


FolderLimit:

TextWarning=
TextError=

Loop,9999
{

IniRead,Folder,FolderLimit.ini,settings,Folder%A_Index%
IniRead,SizeLimit,FolderLimit.ini,settings,SizeLimit%A_Index%
IniRead,WarningPercent,FolderLimit.ini,settings,WarningPercent%A_Index%

If folder = ERROR
Break

FolderSize = 0

Loop, %folder%\*.*,1,1
FolderSize += %A_LoopFileSize%

FolderSizeMB := (FolderSize/1024)/1024

Percent := FoldersizeMB / (SizeLimit / 100)

If Percent >= 100
TextError=%TextError%%Folder% (%FoldersizeMB% MB of allowed %SizeLimit%)`n

If WarningPercent <= %Percent%
If Percent < 100
TextWarning=%TextWarning%%Folder% (%FoldersizeMB% MB of allowed %SizeLimit%)`n
}


; ################ Change message box warnings

If TextWarning <>
msgbox,262208,Folder size warning!,Following folder(s) are nearing their set size limit.`nPlease consider a backup.`n`n%TextWarning%,240

If TextError <>
msgbox,262160,Folder size limit reached!,Following folder(s) exceeded their set size limit.`nBACKUP NOW!`n`n%TextError%,240

Return

ragnar01

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 6
Re: Program to Monitor Size of Specific Directories?
« Reply #3 on: August 08, 2006, 04:14 PM »
I'll check out both the program and the AHK script. The script sounds more like what I had in mind.

I will post comments when available.

Thanks

ragnar01

Original address: https://www.donationcoder.com/forum/index.php?topic=4700.0