(SOLVED) Re: cron job question (for checking kernel updates)

Ranjan Maitra maitra.mbox.ignored at inbox.com
Thu Oct 3 21:38:35 UTC 2013


On Wed, 2 Oct 2013 21:38:26 -0400 Matthew Miller
<mattdm at fedoraproject.org> 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




More information about the users mailing list