How to run X from cron job

Joined
Jan 31, 2009
Messages
1
Reaction score
0
Points
1
I have a very simple csh script that copies files each night. I wanted it to display a message on screen if some error occured. I can't figure out how to get a xmessage to work from a cron job. The xmessage in the script works if I run it manually or set it to run through cron a few minutes from now. But when I set it for 1am it won't display the xmessage. I have tried all the xauth, xhost, and DISPLAY settings I can think of. So far I have DISPLAY set to what I get from a terminal window (a strange /tmp/launch-ewSAT1/:0). I know there has to be a simple way to do this on OS X.

setenv DISPLAY /tmp/launch-ewSAT1/:0
/usr/X11/bin/xmessage "MAC-to-PC Backup Error: /Volumes/DavidFiles not mounted"
X connection to /tmp/launch-ewSAT1/:0 broken (explicit kill or server shutdown).

Thanks,
Chris
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top