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
Auto Delete Old Stuff (Tivo Style)
Re: Auto Delete Old Stuff (Tivo Style)
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.
-
- Release Testers
- Posts: 114
- Joined: January 25th, 2008, 1:10 pm
Re: Auto Delete Old Stuff (Tivo Style)
Remember to share your work afterwards
Re: Auto Delete Old Stuff (Tivo Style)
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.
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.