Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 06-01-2004, 11:20 AM   #1
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)

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?).

Old 06-01-2004, 03:39 PM   #2
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, 08:12 AM   #3
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.


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 01:46 PM
write errors to log file, instead of /dev/null c_r2005 Linux - General 2 07-30-2005 09:34 AM
What applicability of a file /dev/null ukrainet Linux - Newbie 1 12-01-2004 10:04 AM
mv c:\WINDOWS /dev/null; mount /dev/hda treehead Member Intro 5 10-19-2004 09:53 AM
Switch stdout between /dev/null and a file? gremlin2000 Linux - Newbie 1 06-01-2004 11:13 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:40 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
Open Source Consulting | Domain Registration