Before you proceed below please check:
-
Simple apt daily update script, see here.
-
Configure exim4 to send messages by smarthost, no local mail, see here.
We are going enhance daily update script by ability to send a list of new updates to mail.
mailto=debian-updates@dev.local
apt-get -dqq update
apt-get -dyqq upgrade
has_upgrades=$(apt-get -s upgrade | grep ^Inst)
if [ "$has_upgrades" ] ; then
echo "$has_upgrades" | mail -s \
"Updates for $(hostname) on $(date +%Y-%m-%d)" \
$mailto
fi
Alternatively consider using
apticron, read more
here.
No comments :
Post a Comment