[CentOS] Display a warning message at a certain time ?

Geoff Galitz geoff at galitz.org
Thu Feb 4 16:26:14 UTC 2010



> I think the problem boils down to this :
> 
> "How can I run a graphical application from crontab ?"
> 
> I gave it a shot with a simple one (/usr/bin/gcalctool) and didn't
> succeed either.
>



I think if you did something like this:

----------

#!/bin/sh

# set DISPLAY
export DISPLAY="localhost:0"

# send the message
/usr/bin/xmessage -timeout 120 "This is my message"

# exit cleanly
exit 0

---------


You'd be ok.  Run that as a script, making changes for your system where
appropriate and then run that script from cron.  Cron makes very few
assumptions about your environment, your PATHS and other environmental
variables are not getting set. If you run this a script suing "#!/bin/sh"
you should get a default environment as defined by your installation.

-geoff


---------------------------------
Geoff Galitz
Blankenheim NRW, Germany
http://www.galitz.org/
http://german-way.com/blog/






More information about the CentOS mailing list