Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 05-23-2012, 03:01 AM   #1
LQ Newbie
Registered: Feb 2010
Posts: 19

Rep: Reputation: 0
Run cron job in terminal emulator window


I have a backup script that I would like to open up a new terminal emulator window every day it runs from cron, so I can follow what's happening.

How can this be achieved?

Looking forward to your answer! Thanks!
Old 05-23-2012, 03:10 AM   #2
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
The better solution is to have your cron job write to a log file.

Then, you can run
tail -f /log/file
But, what you propose is likely possible. You'd need to "wrap" your existing script with code like this, below. This gets a handle to the GUI session, and then launches gnome-terminal, running your command.

# This is your new cron script.


dbus_address=$(cat /home/$user/.dbus/session-bus/*-0 | \
                grep -v '\#' | \
                grep BUS_ADDRESS | \
                cut -d '=' -f 2-)

# Here, replace /path/to/ with whatever the old cron script was.
    su $user -c gnome-terminal -e "sudo /path/to/"
Anyway, there are still a lot of issues with this. Please don't try to do it; you'd be better off looking at Nagios or some other monitoring software.

Last edited by jhwilliams; 05-23-2012 at 03:13 AM.
Old 05-23-2012, 04:23 AM   #3
Senior Member
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi Beaverfriend

Maybe you could try running your script in screen
- this
- or maybe here

good luck
Old 05-24-2012, 04:06 AM   #4
LQ Newbie
Registered: Feb 2010
Posts: 19

Original Poster
Rep: Reputation: 0
Originally Posted by jhwilliams View Post
The better solution is to have your cron job write to a log file.
You're right, that would be the better solution! Thanks all for tips everyone!


backup, bash, cron, script, terminal

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Debian daily cron job won't run, but does run in cron.hourly. sandersch Linux - General 7 05-24-2012 01:50 AM
Focusing the terminal emulator window in Kate Shay Linux - Software 1 11-01-2006 02:15 PM
how to run this cron job ashley75 Linux - General 5 05-24-2004 11:20 AM
Cron job does not run brentos Linux - General 6 12-12-2003 02:37 PM
What terminal emulator will run from.... Rikarus Linux - Software 9 05-12-2003 02:58 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:52 AM.

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