Question

I want to make a little script which send me a notification when an update is available for pacman. I did that :

#!/bin/sh

while /usr/bin/inotifywait -e create /var/lib/pacman; do
/usr/bin/notify-send "pacmauto" "Updating...";
updateDone=0
while /usr/bin/inotifywait -e delete /var/lib/pacman -t 30; do
    updateDone=1;
done
if [ $updateDone -eq 1 ]; then
    /usr/bin/notify-send "pacmauto" "Update done, you can install it with pacman -Su";
fi
done

But the fact is when i use it with my user prompt, it works. But when i want to put it in a crontab, it doesn't send me a notification when it's done. Someone can help me ?

Était-ce utile?

La solution

So finally, I follow this topic (http://ubuntuforums.org/showthread.php?t=1533494) and it works now. Thanks you Philibobby !

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top