1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Automatic folder size quota.please hep.

Discussion in 'All Other Software' started by jawajoose, May 6, 2010.

Thread Status:
Not open for further replies.
  1. jawajoose

    jawajoose Thread Starter

    Joined:
    May 6, 2010
    Messages:
    1
    OK. thanks in advance.. Im totally stuck on this and I consider myself pretty knowledgeable.

    OS: win7

    I'm trying to make a folder that will only allow 10GB in it, Once it reaches its 10GB max it will just automatically delete the oldest files to make room for the new ones.

    Example: Subscribe to a podcast RSS feed, but only keep the latest 10GB of content and automatically delete the older videos/audio. So that way i always have the latest content but with no excessive HDD bulk.

    Any solutions would be greatly appreciated.
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    There are certainly ways to control quotas on volumes and directories depending on what OS you are running but I have never heard of any way to automatically delete the oldest file once it hits that quota. You would most likely run into some errors along the way. If the directory was at 9.9 GB's and a new podcast starts to download and hits the 10 GB quota for that directory the download will just error out.

    I don't know of any way to do this without some type of 3rd party software that keeps track of your RSS feeds or Podcasts and the ones I have seen do not control that by directory size.

    I subscribe to many podcasts with my Zune and I have the Software set to keep the last 5 episodes of most podcasts. After that it will automatically delete the old ones. I would assume iTunes and other types of software work this way as well.

    If you really wanted to do something like this I think your best bet would be to have a batch file or vbscript run daily or hourly to check the size of the directory. If it is over 10gb's delete the oldest file. Have the script continually loop until the directory size is under 10gb's and then exit when the directory size is small enough.
     
  3. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    Well I was going to do this in batch but google searched and found this vbscript.
    http://blogs.technet.com/heyscripti...hen-that-folder-exceeds-a-specified-size.aspx

    This script will only delete the oldest file in the directory if it exceeds the folder size. If the folder size is still over the specified limit it is not going to try and delete another file. So you would have to use Task Scheduler to have this script run every couple of minutes to make sure the directory is staying below its 10 GB thresh hold.

    The way I was going to setup the batch file it would in theory delete the oldest files once it hits the 10gb limit. Which is easy enough to do with a For loop. You would just sort the directory by newest to oldest and as it parses each file name it will add the file size to a variable. Then check the size against the quota size and if it is over start deleting files.

    But again, you would have to use Task Scheduler to have this script run every so often.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/921388

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice