Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Cron Environment won't run script

    I am trying to get gnome-terminal to open from a crontab. Cron's environment is stopping it. I have tried this:

    * * * * * . /home/steve/.bashrc ; /home/steve/
    and I have tried this:

    * * * * * . /home/steve/.profile ; /usr/bin/gnome-terminal
    Neither will work. How do I fix this?

  2. #2
    may I ask why on earth you are trying to do this? Perhaps there is another way to achieve what you are trying to do, is why I ask.

    It probably needs the DISPLAY env var set, but I'm just guessing. Redirect the output of your script to a log to see the errors.

    * * * * * /home/steve/ > /tmp/stevescript.log 2>&1
    You can also check /var/log/messages and /var/log/cron to see if they say anything.

    To try using the DISPLAY var, put this at the top of steve's script:
    export DISPLAY=:0.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts