can't get crontab to open a gedit window

Asked by George Hunter

I am trying to use cron to issue periodic reminders to me by putting up a gedit window showing a reminder message text file. If I put

* * * * * gedit -s

in the crontab file, I would expect it to open a blank gedit file every minute, but nothing happens. Omitting the -s switch makes no difference.

If I put this line in the crontab file

* * * * * ./test.sh>>crontab.log

 where test.sh contains

#!/bin/bash
date
gedit temp.tmp

then the resulting log file shows a time stamp every minute, but still no sign of a gedit window.

Anyone any ideas?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Who's crontab are you using and what do you log in as to get the desktop session?

What is the output of:

lsb_release -a; uname -a; apt-cache policy crontab

Revision history for this message
George Hunter (c-admin-g) said :
#2

~ >lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
~ >uname -a
Linux george-CM6330 4.10.0-40-generic #44~16.04.1-Ubuntu SMP Thu Nov 9 15:37:44 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
~ >apt-cache policy crontab
N: Unable to locate package crontab

logged in as george and using whatever crontab is generated by the crontab -e command.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

That's all good and correct.

If you change the crontab to:

DISPLAY=:0.0 gedit &

Does it work OK?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Obviously with the asterisks etc

Revision history for this message
George Hunter (c-admin-g) said :
#5

That doesn't seem to help, I'm afraid

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#6
Revision history for this message
George Hunter (c-admin-g) said :
#7

Thanks actionparsnip, that solved my question.