1
我想製作一個小腳本,當更新可用於pacman時,會向我發送通知。我這樣做:通知發送在crontab中不起作用
#!/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
但事實是,當我用它與我的用戶提示,它的工作原理。但是當我想把它放在一個crontab中時,它不會在完成時向我發送通知。有人可以幫助我嗎?
非常感謝。
也許你會發現這個有用的:http://ubuntuforums.org/showthread.php?t=1533494 – Philibobby
謝謝,它現在解決了! –
我建議你添加答案,以便人們可以找到一個解決方案,如果他們在這個線程進入! – Philibobby