Auto-Delete By Date?

Jammin1911Jammin1911 Icrontian
edited February 2008 in Science & Tech
I'm wondering if someone can recommend some sort of software that I can use to automatically manage disk space on a certain specified part of a hard drive.

I'll try to keep it simple.

Basically I have a folder called C:\Incoming

I need some software that will monitor free space on the C: drive and when the amount free hits a specified threshold, say 5GB, it will delete the oldest file it can find somewhere under C:\Incoming just to ensure that the free disk space never drops below 5GB.

Hopefully this makes sense? :)

Comments

  • shwaipshwaip bluffin' with my muffin Icrontian
    edited February 2008
    you could do it with cygwin pretty easily, i'd guess. basically, write a bash script that uses df and rm.
  • ThraxThrax 🐌 Austin, TX Icrontian
    edited February 2008
    Install Cygwin:

    find c:\incoming -ctime +# -daystart -exec rm "{}" \

    Where # is the number of days backwards from midnight of your current day. All files on or prior to that date will be removed.
  • Jammin1911Jammin1911 Icrontian
    edited February 2008
    thanks thrax!

    i'll give this a shot. its not quite the solution I was looking for but it should do the trick for now.

    i've never used cygwin.. i might be bugging you here again if i dont know what im looking at once i get it ;]

    the problem is that some days there is more data than others.. could be up to triple or more in some cases... so this wont manage the space too efficiently in this scenario but it should definitely help.
  • mmonninmmonnin Centreville, VA
    edited February 2008
    Hmm one of the inspection tools at work has an AutoDataDelete program to delete images/files after a set time period. It must be internal software as I can't find it on the intarweb..
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited February 2008
    you could definitely write a more complex bash or perl script to delete as many files as necessary until you have the proper amount of free space.

    You could also use the script to put all the files that have been uploaded that day into a separate folder to keep things neat and tidy.
Sign In or Register to comment.