Jump to content

Program for finding unused files?


Lonig

Recommended Posts

Have a website (corporate interweb actually) that is just filled to the brim with useless files that aren't used. However, the current setup has multiple locations pulling from multiple directories, so I cannot be certain deleting a file I am 80% sure about....Are there any programs that you all will recommend for crawling a site and listing eithera) What is linked to what:) The files that are not used at allNot sure if B is possible, but at least option A will help us only verify the ones it flags as unused.As a side note, I've considered just renaming files in question and waiting until someone complains... but since this place is 24/7 and some of this is very important data(that may require a not so important "reminder" page before you get to the good stuff) I have ruled that out for now. But that is the plan for once we run a program like the above, rename for a week or two then backup and delete from server.Any advice/pointers would be appreciated

Link to comment
Share on other sites

You can crawl the site using PHP (e.g. though recursive glob() calls) and delete /flag files that haven't been accessed / modified since a certain date:http://au2.php.net/manual/en/function.fileatime.phphttp://au2.php.net/manual/en/function.filemtime.phpOption 'a' would be much harder, as you would have to parse the files and build up a table of the links in it, then run lots of queries to determine what links to what. That's what search engines do :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...