Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an aging website I'm managing and I'd like to remove all unused external files (.css, .jpg, .js, etc.) that are currently in various folders all over the site.

Is there a tool out there that can help me identify and/or remove these for me?

share|improve this question
1  
This question is related and might also have helpful suggestions: serverfault.com/questions/131778/deleting-old-unused-images –  William May 30 '10 at 22:57

3 Answers 3

up vote 1 down vote accepted

There are several utilities to download entire websites. Run one, follow all links to your site, but not to any other sites. Anything not in the resulting archive could be deleted.

share|improve this answer
2  
Unless someone else is linking to the content. Best to move the unused content elsewhere then check your logs for a while afterwards. –  Iain May 30 '10 at 16:39
    
Thanks, this solved my problem. I cut the website size in half. I ended up using httrack.com. –  Byrån May 31 '10 at 3:49
    
Iain brings up a good point. Is it your policy to disallow deeplinking? If not, then you could follow his advice of archiving the existing site and then watching your logs. –  Kevin M May 31 '10 at 14:54

My first thought is to write a script that reduces a few months worth of raw log files down to just the URI part of them, then gathers a directory listing, and finally loops through the directory listing and lists everything that doesn't have a corresponding appearance in the condensed log file.

share|improve this answer
1  
ya know? I'm in the same boat as the OP. I think there may be a market for such a script... –  Chris_K May 30 '10 at 12:30

Several editors like Dramweaver and Expression Web have built-in utilities to detect unlinked files in the site. I don't know of any free tools, but I'd be surprised if there isn't.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.