Re: cron job question (for checking kernel updates)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2 Oct 2013 20:53:52 -0500 inode0 <inode0@xxxxxxxxx> wrote:

> On Wed, Oct 2, 2013 at 10:10 AM, Ranjan Maitra
> <maitra.mbox.ignored@xxxxxxxxx> wrote:
> > 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
> 
> export DISPLAY=:0

I was wondering -- why, instead of this, the following would not work:

export $(env | grep DISPLAY)


Note that:

echo  $(env | grep DISPLAY)>/tmp/tmp.txt

creates a blank file so there is a problem, clearly.

Just trying to see if I can easily hardcode the DISPLAY variable.

Thanks!
Ranjan

> 
> > 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 ---
> 
> Give that a try if you haven't yet Ranjan.
> 
> John
> -- 
> users mailing list
> users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org


-- 
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.

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
Check it out at http://www.inbox.com/earth


-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux