Link Checking Script

Andrew Bates andrewb at litecode.net
Fri Jul 12 02:06:05 CDT 2002


make sure you are running a combined apache log format

Logfile file combined

okay, now that you have that done..

use this one-liner

grep 404 {LOGFILE} | gawk '{print $7}' | sort -u

then if you really wanted to find where the link is... just take a line, 
then execute this command..

grep {LINK} `find {WEBDIRECTORY}`

as long as you don't have way to many files for it to search, it will 
find it.

- Andrew Bates

This should print all the 404 problems in your log file.

Michael wrote:

>Try using wget. Have it save it's results to a log file and search the log
>for errors. You'll quickly be able to pinpoint bad links.
>
>  
>
>>Anybody have a script to check link for a Linux/Apache server?  Of the ones
>>I've found so far, the only one that works is pretty buggy.
>>    
>>
>
>
>
>
>  
>




More information about the Kclug mailing list