cron job question (for checking kernel updates)

Ranjan Maitra maitra.mbox.ignored at inbox.com
Thu Oct 3 00:55:51 UTC 2013



On Thu, 3 Oct 2013 02:17:09 +0200 poma <pomidorabelisima at gmail.com>
wrote:

> On 02.10.2013 22:06, Ranjan Maitra wrote:
>> > However, what I do not understand is why this does not "work" though. I
> > do not understand because notify-send is in /usr/bin as well as in /bin:
> > 
> > $ which notify-send 
> > notify-send is /bin/notify-send
> > notify-send is /usr/bin/notify-send
> > 
> > Both appear to be in the path. So where is the problem? 
> 
> 
> http://goo.gl/Mqq6UP

Thanks! But this does not "work" either. Here is what I tried in my
crontab -e:

0 * * * * maitra DISPLAY=:0.0 $HOME/scripts/yum/check-kernel.sh

(maitra is my username).

Here is how I changed my check-kernel.sh, though I am not sure if there
was a problem with the earlier one....

$more check-kernel.sh 

#!/bin/bash
# from http://goo.gl/Mqq6UP

latestkernel=$(rpm -q kernel |tail -n1|sed -e 's/kernel-//')

#echo "$latestkernel"

if uname -a | grep -qv "$latestkernel"; then
notify-send "Kernel UPDATE on ${HOSTNAME}: " \
"<b><i>Running</i></b> kernel is 
<b><i>$(uname -r | awk '{gsub(/*PAE/,""); print}')</i></b>
but <b>latest</b> <b><u>installed</u></b> is
<b><u>${latestkernel}</u></b>
required
<b><u>REBOOT</u></b>"
fi;

How do you get yours to work?

(Works fine from the commandline, of course.) Btw, FWIW, I am using
dunst.

Many thanks,
Ranjan

____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!
Check it out at http://www.inbox.com/marineaquarium




More information about the users mailing list