Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I set the following cron in my local machine.

* * * * * /bin/bash -c /home/JSX/Stuff/J/login-check/

The content of is the following:-

#! /bin/sh
gnome-terminal --full-screen --hide-menubar -e /home/JSX/Stuff/J/login-check/

It is supposed to open another sh script in terminal. But nothing is happening. Is there anything else I need to do? Like restarting a service or something for the cron job to start running?

*** Absolute paths given in the files are correct. When I entered the command /bin/bash -c /home/JSX/Stuff/J/login-check/ directly in the terminal, it worked.

share|improve this question
up vote 5 down vote accepted

Cron has no idea where the current display is (from its point of view, there can be many running), so it cannot -- easily -- start a graphical terminal. If you are the only user of the machine with only one X session, you can try to define your DISPLAY variable

export DISPLAY=:0.0

in, but I'm not sure whether it will work.

The main purpose of cron is to start non-interactive services that run in the background at specified points of time. Other tasks should be handled with dbus and ConsoleKit, but this is a bit more complicated, see this question.

share|improve this answer
That was it :) Thank you for the solution and insight. – Sparky Oct 19 '12 at 7:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.