check_pacman

Pour avoir la liste des paquets non à jour grâce à cron, mettre dans /etc/cron.daily/check_pacman :

#!/bin/bash

pacman -Sy > /dev/null
rm -f /tmp/mail.log /tmp/mail.2.log
cd /var/lib/pacman/local
ls -d *|while read a
do
        PKG_NAME=${a%%-[[:digit:]]*}
        [ "`ls -d ../*/$a|wc -l`" = "1" ] && \
        if [ "`ls -d ../*/$PKG_NAME-[[:digit:]]* |wc -l`" = "2" ]
        then echo "New package for: $PKG_NAME" >> /tmp/mail.log
        else echo "No package for: $PKG_NAME" >> /tmp/mail.log
        fi
done
if [ -r /tmp/mail.log ]
then
        sort /tmp/mail.log > /tmp/mail.2.log
        mail gnunux@gnunux.info -s "Rapport de check_pacman" < /tmp/mail.2.log
fi
rm -f /tmp/mail.log /tmp/mail.2.log

Haut de page