* Thus wrote Verdon vaillancourt ([EMAIL PROTECTED]):
> Hi :)
>
> I need to write a script that will scan/read a given directory's contents
> and delete files older than a certain date. Ideally, this will be a script
> that runs via cron once a week and deletes all files it finds in the
> directory older than 2 weeks from the current date. I do currently have
> scripts running via cron and that's no problem. I'm not sure where to begin
> with the other components
hm.. there are tools aleady available that do this on unix.
find /path/to/files/ -type f -mtime '+14' -exec rm {} \;
>
> I'm not looking to be spoon-fed, but I was hoping that someone could point
> me in the right direction to start researching.
If you still desire to write a php script:
php.net/dir - for directory reading stuff
php.net/stat - gets the stats on files.
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php