cron job question (for checking kernel updates)

Joe Zeff joe at zeff.us
Thu Oct 3 01:40:48 UTC 2013


On 10/02/2013 05:55 PM, Ranjan Maitra wrote:
> Thanks! But this does not "work" either.

There may be a much easier way: before your cron job starts the update, 
have it do this:

yum check-update > /tmp/updates.txt

Then, after the update, grep /tmp/updates.txt looking for kernel, 
redirecting the output to /dev/null because all you need is the exit 
status.  If there are any matches, it returns 0 and the script can 
notify you that it needs rebooting. (Sending email might be the best 
way.)  If not, it does nothing.  And, the nice thing about this is that 
it ends up being exactly one script, run once a day.


More information about the users mailing list