1. 程式人生 > >Use Wget to Detect Dead Links

Use Wget to Detect Dead Links

Typical wget usage:

wget -r --spider -b -o /var/tmp/wget.log http://target.site.com/

-r - Recursive download
--spider - Check downloaded content for new links, then discard
-b - Run in the background
-o /var/tmp/wget.log - Target log file

http://target.site.com/ - Replace with the site you want to check

wget will create a log file detailing the status codes reported while downloading content from the target site - note that this method will catch links to nonexistent content from within the domain, however, off-site links will not be checked (which is why it pays to monitor your site’s error logs).

Reference

blog comments powered by Disqus