View previous topic :: View next topic |
Author |
Message |
Whoo n00b
Joined: 25 May 2003 Posts: 27 Location: Quebec ;)
|
Posted: Sat Aug 02, 2003 3:00 pm Post subject: Emerge Automatique |
|
|
Comme j'ai plusieurs serveurs sous gentoo, j'aime bien être prévenu pour la mise à jour des packages .... Alors j'ai fait ce petit truc:
/etc/cron.script/emerge.cron:
Code: |
#!/bin/bash
/usr/bin/emerge rsync &>/dev/null
/usr/bin/emerge -up --nospinner --columns world | grep "ebuild" | \
sed \
-e 's= *=</td><td>=g' -e 's/^/<tr><td>/g' \
-e 's=$=</td></tr>=g' \
-e 's=] \([a-z]\)=] </td><td>\1=g' > /tmp/world
A=$(cat /tmp/world | wc -l )
if [ ! "$A" -eq 0 ]
then
echo "From: Emerge Checker <root@`hostname`>
Content-Type: text/html
Subject: Emerge for `hostname`
To: Admin of `hostname` <root@`hostname`>
<html>
<body>
<h1>Emerge for `hostname` - `date +'%D'`</h1>
<h2>($A packages )</h2>
<table border=1>
`cat /tmp/world`
</table>
</body>
</html>" | /usr/sbin/sendmail $@
fi
|
Puis un petit:
Code: |
0 */4 * * * /etc/cron.script/emerge.cron mon@email
|
@+ Whoo |
|
Back to top |
|
|
DuF Advocate
Joined: 09 Dec 2002 Posts: 2687 Location: Paris
|
Posted: Sat Aug 02, 2003 4:21 pm Post subject: |
|
|
Il me semble que sur gentoofr.org il y avait eu un script dans le même genre sauf que c'était pour être prévenu de nouveaux packages mais seulement pour ceux qu'ont souhaitais. Ca peut revenir au même, suffit d'adapter, enfin bon c'est sympa de poster ces scripts pour partager avec les autres. |
|
Back to top |
|
|
|