Cron won't open console to run script
I am trying to get cron to run a script in a console. The script must run in a console because it requires interaction. Using KCron, I have added the line:
Code:
/usr/bin/konsole -e /home/rollo/scripts/script.sh Code:
rollo@KanotixBox:/var/mail$ crontab -l Run directly from KCron ("Run it now"), the script works fine and Konsole opens correctly. What could be going on? Help much appreciated. |
Probably needs your $DISPLAY variable exported.
|
Thanks for that.
My cron command now reads: Code:
40 19 * * * DISPLAY=0.0; export DISPLAY; /usr/bin/konsole -e /home/rollo/scripts/script.sh What am I doing wrong here?.. |
Add the line export DISPLAY=":0.0" inside your script.sh below the bang (!#/bin/someshell) line.
|
Thanks again.
Adding the export variable line in the script makes no difference. Presumably because by that stage cron has already failed to run /usr/bin/konsole. Reminder of the cron line: Code:
0 21 * * * /usr/bin/konsole -e /home/rollo/scripts.script.sh Any ideas where next?:scratch: |
Solved
Found the solution. To get cron to run the X app Konsole correctly, add the display switch to the command. Like this:
Code:
/usr/bin/konsole -display :0.0 -e /path/to/script Rollo |
All times are GMT -5. The time now is 08:51 AM. |