LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-21-2005, 09:33 AM   #1
Phaethar
Member
 
Registered: Oct 2003
Location: MN
Distribution: CentOS, Fedora
Posts: 182

Rep: Reputation: 30
Opening a terminal window through Cron


Hey all,

I'm trying to find a way to get a scheduled job to open up in an xterm window every day. I've used Cron enough, and I've tried a few different methods of this, but no matter how I try it the job will always run in the background. So, I need to find out of there's a way to schedule a job and have it open up and run in an xterm window. The system I'm attempting this on is a Fedora 4 system.

Any way to do this?

TIA
 
Old 12-21-2005, 09:43 AM   #2
Gort32
Member
 
Registered: Sep 2004
Distribution: Slack!
Posts: 150

Rep: Reputation: 15
In order to have an app appear in X without being run by the actual user, you will have to set your DISPLAY varible.

Code:
#!/usr/bin/bash
export DISPLAY=:0
/usr/X11R6/bin/xterm
You may have to play with your xhost permissions as well - check out man xhost for details.
 
Old 12-21-2005, 09:44 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
It seems to me that another way to do this would be to have a logged-on user running a scheduler/alarm-clock program within his own session. If the session remained logged-on ...
 
Old 12-21-2005, 09:46 AM   #4
Phaethar
Member
 
Registered: Oct 2003
Location: MN
Distribution: CentOS, Fedora
Posts: 182

Original Poster
Rep: Reputation: 30
Quote:
In order to have an app appear in X without being run by the actual user, you will have to set your DISPLAY varible.
Thanks Gort32, I'll give this a shot. Sounds like it may do what I'm looking for.

Quote:
It seems to me that another way to do this would be to have a logged-on user running a scheduler/alarm-clock program within his own session.
This is what we're doing now, and it's having some strange issues. So, as a way to test this, I wanted to have the OS fire things off intead of a scheduler.

Thanks!
 
Old 12-21-2005, 10:21 AM   #5
Phaethar
Member
 
Registered: Oct 2003
Location: MN
Distribution: CentOS, Fedora
Posts: 182

Original Poster
Rep: Reputation: 30
Quote:
In order to have an app appear in X without being run by the actual user, you will have to set your DISPLAY varible.
Ok, still no luck with this. If I set up a script and run it manually, this works great, and I can control where the xterm shows up.

However, setting it up to run automatcially through Cron will result in nothing showing up. It runs, according to the logs.. but the xterm window will not show up using this method.

So, back to the drawing board for now.

Any other suggestions on how to get a terminal or xterm window to open using Cron (or something similar)?
 
Old 12-21-2005, 12:53 PM   #6
Gort32
Member
 
Registered: Sep 2004
Distribution: Slack!
Posts: 150

Rep: Reputation: 15
Try running xhost + as the user in a terminal, then have cron go off.
 
Old 12-21-2005, 02:02 PM   #7
Phaethar
Member
 
Registered: Oct 2003
Location: MN
Distribution: CentOS, Fedora
Posts: 182

Original Poster
Rep: Reputation: 30
Gort32,

xhost + tells me that access control is disabled and that clients can connect from any host. However, still no luck in getting Cron to spawn a new terminal or xterm window. Again, the job seems to run, but nothing will show up on screen.

I know this is by design with Cron, but it sure would be nice if there was an option to run a scheduled job in a terminal window to see the results in real time.

Thanks for your help on this.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why mandriva 10.2 gnome2.8 system freezes upon resizing/opening window/new window skaramanger Mandriva 8 08-30-2005 10:22 AM
why mandriva 10.2 gnome2.8 system freezes upon resizing/opening window/new window skaramanger Mandriva 2 08-15-2005 04:38 PM
Opening a terminal with keyboard hotkeys? Cinematography Linux - Software 4 06-04-2005 03:47 PM
Opening a new terminal from Fluxbox menu (or another terminal) hallamigo Linux - Software 1 05-02-2004 03:32 AM
problem in opening multiple Terminall Sessions in the same Terminal Window gem_skywalker Linux - General 2 12-19-2003 05:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration