Operating System - HP-UX
1834414 Members
1903 Online
110067 Solutions
New Discussion

Re: Cannot start a dterm or xterm window using crontab

 
PeterCh
Occasional Advisor

Cannot start a dterm or xterm window using crontab

Hi,

I am having problems doing the above in HPUX 10.20.
I want to run a job in an xterm window using crontab. In my crontab file I have added the line

00 12 * * * /tmp/test.sql &

In the file test.sql is the contents

. /home/oracle/.profile
xterm ..... -e top &

But at the cron job time, the xterm window does not pop up on the console. I have tried this with dtterm and it does not work either.
If I run the command /tmp/test.sql manually as the oracle user, it works, but it doesn't when I put it in the crontab file.
Any help is much appreciated. Thanks in advance!
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: Cannot start a dterm or xterm window using crontab

Have you exported DISPLAY to the right value in your script?
Also your profile may test for being interactive and not set DISPLAY. So echo $DISPLAY after you source .profile.
PeterCh
Occasional Advisor

Re: Cannot start a dterm or xterm window using crontab

Yep, that seemed to be the problem. Don't know how I missed that!
Thanks!
Reshma Malusare
Trusted Contributor

Re: Cannot start a dterm or xterm window using crontab

Hi Peter,

Check out for DISPLAY variable.