Auto Delete Old Stuff (Tivo Style)

Come up with a useful post-processing script? Share it here!
Post Reply
jayc
Newbie
Newbie
Posts: 3
Joined: January 19th, 2009, 12:48 am

Auto Delete Old Stuff (Tivo Style)

Post by jayc »

I'm trying to create a script that would delete anything older than x number of days.

I've written a script that does what I'm looking for in PHP.  My main problem now is that the file dates are not when the file was downloaded.  They are instead, when the file was originally created/uploaded to usenet.

I've found that the php touch command would allow me to set the date to my date of download.

My problem now is that I don't know how to access the file name(s) of the files downloaded while I'm in my php script.  Any ideas or do I have to learn a new language?

J
jayc
Newbie
Newbie
Posts: 3
Joined: January 19th, 2009, 12:48 am

Re: Auto Delete Old Stuff (Tivo Style)

Post by jayc »

I think I have it figured out.  I'll just do a touch on dir/*, then make my script to a cleanup of any files older than x days if it starts to get low on space.
huleboeren
Release Testers
Release Testers
Posts: 114
Joined: January 25th, 2008, 1:10 pm

Re: Auto Delete Old Stuff (Tivo Style)

Post by huleboeren »

Remember to share your work afterwards :P
jayc
Newbie
Newbie
Posts: 3
Joined: January 19th, 2009, 12:48 am

Re: Auto Delete Old Stuff (Tivo Style)

Post by jayc »

Sure, no problem.

Basically, my folder ever has less than 2GB free, it will delete the oldest 2GB of files in that folder.

http://pastie.org/436870

If anyone has a hankering to convert this, I'd love if it were native to SABNZBD.  Unfortunately, I'm not a python guy.
Post Reply