Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-13-2004, 12:07 PM   #1
LQ Newbie
Registered: Jul 2004
Posts: 1

Rep: Reputation: 0
Question Problem displaying program output when driven by a cron job

I'm not sure if what I'm trying to do is even possible, but here's the situation:

I have several boxes running Red Hat 7.0. They continuously run a program that generates a substantial amount of screen output - letting us know that the program is running and operating properly. Due to some intermittent problems with this program, we're running in in a debug mode where a log file of everything the program does is generated.

Because the log file rapidly grows to an enormous size, every day the program must be stopped, the log file moved, and then the program restarted. I've been doing this manually, but I'd prefer to automate it.

I've written a series of scripts that take care of the log file cleanup and I want to run them all as cron jobs late at night so service isn't impacted.

The problem I'm having is this: I can use the scripts/cron jobs to run the program in the background just fine, but this means the screen output is not visible. Is there some way of telling cron to open a console window and run the program within that, rather than in the background, when all screen output is either lost or emailed to root?

I can live with running it in the background, but I'd much rather be able to see the screen output as it's occurring.

Any ideas? Thanks in advance.
Old 07-22-2004, 03:34 PM   #2
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
Er, you can try running it and redirecting output via a >

For instance

0 * * * * /home/scripts/somescript > /var/logs/some_log 2>&1

Normally you'd send that junk to /dev/null, but the above may work for you.


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
scp problem in cron job andreolira Linux - General 9 09-08-2008 05:27 PM
cron job problem graziano1968 Linux - Software 7 08-27-2005 01:41 AM
problem in cron job setting gauravdream Linux - General 1 02-23-2004 01:08 AM
Command-driven interactive C++ program Y0jiMb0 Programming 11 01-13-2004 08:24 AM
Cron Job Problem Corellon Linux - Software 4 08-12-2003 04:27 AM > Forums > Linux Forums > Linux - Newbie

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

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