LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-01-2004, 10:20 AM   #1
gremlin2000
LQ Newbie
 
Registered: Apr 2004
Posts: 5

Rep: Reputation: 0
Switch stdout between /dev/null and a file?


(Originally posted to the newbie forum, but it was suggested that that was not the correct place)

Hello,
I have a script which I run using nohup. When I run it it will (as expected) redirect the output to the file nohup. This is great because I can tail -f the file and see whats going on. I want to stop this file from filling my disk while I'm not logged in (but leave the script running) but still be able to tail -f it to see the output when I am logged in. Is there a way to switch the output from nohup between this file and /dev/null while it is running?
(or maybe use cron to truncate the file every now and then?).

Cheers,
Gremlin.
 
Old 06-01-2004, 02:39 PM   #2
brassfish
LQ Newbie
 
Registered: Jan 2004
Distribution: gentoo
Posts: 17

Rep: Reputation: 0
Setup a crontab entry that does a 'tail filename>filename' every few minutes.
 
Old 06-08-2004, 07:12 AM   #3
gremlin2000
LQ Newbie
 
Registered: Apr 2004
Posts: 5

Original Poster
Rep: Reputation: 0
That's not a bad idea. It did the job until I discovered the screen command. That does the job without having to direct the output to a file and I can easily have several of them running.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What would happen if I where to cat /dev/mem > /dev/null Joey.Dale Linux - General 11 07-26-2009 12:46 PM
write errors to log file, instead of /dev/null c_r2005 Linux - General 2 07-30-2005 08:34 AM
What applicability of a file /dev/null ukrainet Linux - Newbie 1 12-01-2004 09:04 AM
mv c:\WINDOWS /dev/null; mount /dev/hda treehead LinuxQuestions.org Member Intro 5 10-19-2004 08:53 AM
Switch stdout between /dev/null and a file? gremlin2000 Linux - Newbie 1 06-01-2004 10:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:43 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