1

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 ?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Juanwolf
  • 840
  • 9
  • 19
  • 2
    Maybe you will find this usefull: http://ubuntuforums.org/showthread.php?t=1533494 – 0x9BD0 Apr 08 '14 at 22:31
  • I suggest you add the answer bellow so that people will find a solution if ever they en up on this thread! – 0x9BD0 Apr 09 '14 at 13:45

1 Answers1

2

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

Juanwolf
  • 840
  • 9
  • 19