Hi,
I suggest you to try apticron (Simple tool to mail about pending package 
updates), does exactly what you want with some handy conf options.


On Mon, Jul 11, 2011 at 04:37:46PM +0200, Bonno Bloksma wrote:
> Hi,
> 
> I have a small script that checks if any updates are needed.**
> 
> I used to have this script in /etc/network but that does not seem a
> realy good location for it. Where would one keep scripts that are
> specific for our company but are on several systems and provide
> maintenace info, etc. for those systems?
> 
> I'd rather not keep them in /root although most scripts are rus as root.
> 
> upgradereport.sh
> ----------<quote>---------------------------------
> #!/bin/bash
> 
> MAILREC="us...@tio.nl us...@tio.nl"
> SUBJECT="Upgrade report voor $HOSTNAME"
> TMPFILE=/tmp/upgradereport.tmp
> 
> # Stap 1: ververs de repositories...
> apt-get update >/dev/null 2>&1
> 
> # Stap 2: toon de upgrades
> apt-get --dry-run upgrade | grep Inst > $TMPFILE
> if egrep -q ^Inst $TMPFILE
> then
>  mail -s "$SUBJECT" $MAILREC < $TMPFILE
> fi
> 
> rm $TMPFILE
> ----------<quote>---------------------------------
> 
> p.s.
> The script above DOES send output when call via a line in crontab or
> by hand but does NOT when placed in /etc/cron.daily.
> Anyone know why?
> 
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a
> subject of "unsubscribe". Trouble? Contact
> listmas...@lists.debian.org
> Archive: http://lists.debian.org/bdf68c0531dd4ad38add893e2b1bc...@staf.tio.nl


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110711151338.gb15...@debian-movil.com.ar

Reply via email to