Forum › Forums › General › Software › apt-notifier, when run from cron doesnt show the upgradable packages [SOLVED] › Reply To: apt-notifier, when run from cron doesnt show the upgradable packages [SOLVED]
fehlix, Thanks for the replies. If you need a tester, I have multiple antiX and MX systems available.
In the meantime I temporarily added a pop up terminal display of the list to my screen before running apt-notifier to put the icon in the tray, etc. I suppose I could just run the upgrade from there, but its just a temporary solution. I do like the user friendly icon and configurable updater, but just can’t always afford the memory. I couldn’t use roxterm because it doesn’t allow for a -hold option, so I used xterm instead.
It still bothers me that I couldn’t figure out how to call apt-notifier correctly, but it just takes time and experience to learn I guess…
# see how many updates are needed
updates=$(aptitude search "~U" | wc -l)
anpid=$(ps aux | grep '[a]pt-notifier' | awk '{print $2}')
# and check the output says 0...
if [[ "$updates" -eq 0 ]]; then
# no upgrade needed
# if apt-notifier is running, it is wasting memory, so kill it
if [[ ! -z $anpid ]]
then
# echo "kill it"
kill $anpid
fi
else
# upgrade needed
# if apt-notifier is not running, start it so it appears in system tray
if [[ -z $anpid ]]
then
# echo "start it"
# start it
xterm -title "NOTICE: Updates Available" -hold -display :0.0 -e apt-get -o Debug::NoLocking=true --trivial-only -V dist-upgrade &
apt-notifier &
fi
fi
exit 0
- This reply was modified 5 years, 2 months ago by BobC.
Attachments:
Here is the link to SEARCH THE FORUM >> http://www.antixforum.com/search-forums
