linkchecker/linkcheck-cron.sh
2004-01-30 10:16:53 +00:00

14 lines
549 B
Bash
Executable file

#!/bin/sh
# this script is intended to be run daily from cron
# GNU GPL Copyright (C) 2004 Bastian Kleineidam
# Put here your url(s) you want to check, separated by whitespace.
# Urls can also be local files, eg "/var/www/index.html".
URL="http://www.imadoofus.org/"
PATH="/bin:/usr/bin"
LOGFILE="$HOME/.linkchecker_blacklist"
linkchecker -Fblacklist/$LOGFILE $URL
# this awk script complains if urls fail for at least two script runs
[ -r $LOGFILE ] && awk '/^[[:digit:]]+/ {if ($1 > 1) printf "URL %s failed for %d days.", $2, $1; }' $LOGFILE