LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-13-2004, 11:07 AM   #1
garmon
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, 02:34 PM   #2
Technoslave
Member
 
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.
 
  


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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