[PLUG] SOLVED Make cron send an e-mail upon completion

John Jason Jordan johnxj at gmx.com
Tue Jan 28 07:30:26 UTC 2020


On Mon, 27 Jan 2020 22:40:09 -0800
Ben Koenig <techkoenig at gmail.com> dijo:

>> Oh wait, it won't. I had been running the script over and over today
>> to set up the message window, but I had been running it as me (jjj).
>> Just now I tried it with sudo and the message failed:
>>
>> No protocol specified
>> Unable to init server: Could not connect: Connection refused
>> gxmessage: unable to initialize GTK

>Use the $DISPLAY variable to launch on a target X server. Since you on
>a desktop system you probably only have X running once, so try
>something like this
>DISPLAY=:0 gxmessage <args go here>
>
>you can echo $DISPLAY to find out what display is currently running.
>Setting the env variable before any graphical command can be used to
>specify which x server/screen you want it to be displayed on. cron
>jobs run outside of X, so $DISPLAY is usually unset.

Thanks, but it still isn't working. I started by setting DISPLAY=:0 as
in your example, but when it didn't work I did:

echo $DISPLAY
:0.0

And then I changed it to DISPLAY=:0.0, but it still doesn't work.

It sounds like you're onto the solution, but it's too late and I can't
think any more. I'll hit it again in the morning.



More information about the PLUG mailing list