View Single Post
allnameswereout's Avatar
Posts: 3,397 | Thanked: 1,212 times | Joined on Jul 2008 @ Netherlands
#35
Originally Posted by grog View Post
I hadn't thought that it might be just that the DISPLAY hadn't been set. Unfortunately it still won't work via the cron implementation I'm using. I've tried all of the following forms & none of them work.

Code:
*/10 * * * * DISPLAY=:0.0 rndback
Code:
*/10 * * * * (DISPLAY=:0.0; rndback)
Code:
DISPLAY=:0.0
*/10 * * * * rndback
After working with various cron's over the years I've come to expect this kind of thing. About the only method I haven't tried is to put the lines into a script & running the script instead, but to tell you the truth, su works just fine & I have any issues doing it that way. But thanks for the help anyway.
root ; export DISPLAY="" ; DISPLAY=:0.0 ecoach && works # :-)

So it should work the other way around too because $DISPLAY is owned by user.

I always use scripts because they're easier to modify.

To have crontab set up for user do crontab -u user. Also see the crontab man page, it would have easily explained this to you.

Edit: your 2nd command is incorrect because you don't use a ; after you set a environment. You put this before the environment, or you use export command (in Bash). The 3rd won't work because you screwed the crontab file format. Probably, the issue is that the variable is not passed to the application, so you'd have to use export or a script. But I recommend crontab for user in any case.
__________________
Goosfraba! All text written by allnameswereout is public domain unless stated otherwise. Thank you for sharing your output!

Last edited by allnameswereout; 2008-12-12 at 19:14. Reason: Edit: