(SOLVED) 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 21:38:26 -0400 Matthew Miller
<mattdm@xxxxxxxxxxxxxxxxx> wrote:

> On Wed, Oct 02, 2013 at 07:55:51PM -0500, Ranjan Maitra wrote:
> > 0 * * * * maitra DISPLAY=:0.0 $HOME/scripts/yum/check-kernel.sh
> 
> Did you try the things in the blog post I'd linked to? As I said in my
> previous method, notify-send needs to talk to your dbus session, and it
> can't get that from inside cron.
> 
>   http://earlruby.org/2008/08/update-pidgin-status-using-cron/
> 
> has a way of working around that.

Following, this post pointed to me my Matthew Miller, I am able to get
things working. Here is what I did (same as in the post there).

Created a file as follows (called ~/bin/export_x_info):

#!/bin/bash
# Export the dbus session address on startup so it can be used by cron
touch $HOME/.Xdbus
chmod 600 $HOME/.Xdbus
env | grep DBUS_SESSION_BUS_ADDRESS > $HOME/.Xdbus
echo 'export DBUS_SESSION_BUS_ADDRESS' >> $HOME/.Xdbus
# Export XAUTHORITY value on startup so it can be used by cron
env | grep XAUTHORITY >> $HOME/.Xdbus
echo 'export XAUTHORITY' >> $HOME/.Xdbus

----
make the file executable:

$ chmod 700 ~/bin/export_x_info

Change this to be sourced at startup. I added the line to
~/.config/openbox/autostart: 

/home/maitra/bin/export_x_info&

----

added the following line to crontab (via crontab -e):

37 * * * * source $HOME/.Xdbus; nice -n 19
$HOME/scripts/yum/check-kernel.sh

This works now!

Thanks very much everybody's help!
Best wishes,
Ranjan

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


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