[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: location script



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="user1@tio.nl user2@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-REQUEST@lists.debian.org with a
> subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
> Archive: [🔎] BDF68C0531DD4AD38ADD893E2B1BC550@staf.tio.nl">http://lists.debian.org/[🔎] BDF68C0531DD4AD38ADD893E2B1BC550@staf.tio.nl


Reply to: