Results 1 to 2 of 2
I am trying to get gnome-terminal to open from a crontab. Cron's environment is stopping it. I have tried this:
Code:
* * * * * . /home/steve/.bashrc ; /home/steve/script.sh
...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-05-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 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:
and I have tried this:Code:* * * * * . /home/steve/.bashrc ; /home/steve/script.sh
Neither will work. How do I fix this?Code:* * * * * . /home/steve/.profile ; /usr/bin/gnome-terminal
- 10-05-2011 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,685
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.
You can also check /var/log/messages and /var/log/cron to see if they say anything.Code:* * * * * /home/steve/script.sh > /tmp/stevescript.log 2>&1
To try using the DISPLAY var, put this at the top of steve's script:
Code:export DISPLAY=:0.0


Reply With Quote
