cron job question (for checking kernel updates)

Ranjan Maitra maitra.mbox.ignored at inbox.com
Wed Oct 2 15:10:45 UTC 2013


Hi,

I have a cron job running which yum updates all my machines once a day.
All of these work fine.

I also have a cron job which checks for kernel updates every hour and
sends me a message if an updated kernel has been installed. Here is the
relevant script:

--- begin file called check-kernel.sh in my scripts/yum directory---

#!/bin/bash

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}: Running Kernel is $(uname
-r) but lat est installed rpm is ${latestkernel}; REBOOT required" 
fi;


--- end file called check-kernel.sh ---

(A bit wordy, I know.)

I have verified that this is executable and works from the commandline
without any errors.

I have the following set up via crontab -e:

0,15,30,45 * * * * nice -n 19 $HOME/.xplanet/download_xplanet_cloudmap
5 * * * * nice -n 19 $HOME/scripts/yum/check-kernel.sh

The first line downloads cloudmaps for use with xplanet and works just
fine (or appears to) and has done so for aeons.

However, nothing happens (or appears to) for the second line. 

What is wrong here?

Many thanks and best wishes,
Ranjan


-- 

Important Notice: This mailbox is ignored: e-mails are set to be
deleted on receipt. Please respond to the mailing list if appropriate.
For those needing to send personal or professional e-mail, please use
appropriate addresses.

____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails




More information about the users mailing list