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

location script



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?



Reply to: