User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
aptchecker [2006/11/13 13:23]
aptchecker [2006/11/13 14:50] (current)
andi old revision restored
Line 1: Line 1:
 +====== APT-Checker ======
 +This script is meant to be run from ''/​etc/​cron.daily/''​. It checks for available updated packages on a Debian system and sends a mail to the administrator.
 +<code bash>
 +MAILFROM="​apt checker <​>"​
 +apt-get update >/​dev/​null 2>&1
 +NEWPACKAGES=`apt-get --print-uris -qq -y upgrade 2>/​dev/​null |awk '​{print $2}'`
 +if [ "​$NEWPACKAGES"​ != ""​ ]
 +  mail -a "From: $MAILFROM"​ -s "New Packages for $HOSTNAME"​ $MAILTO <<EOF
 +There are new Packages available for $HOSTNAME:
 +please run:
 +  ssh root@$HOSTNAME '​apt-get upgrade'​
 +exit 0;
aptchecker.txt ยท Last modified: 2006/11/13 14:50 by andi