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.
#!/bin/sh
mailto=debian-updates@dev.local
# Download only; package files are only retrieved, not
# unpacked or installed.
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