LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 06-12-2007, 12:59 PM   #1
rrosnowski
LQ Newbie
 
Registered: Jun 2007
Posts: 6

Rep: Reputation: 0
Redirecting output to a compressed file


i have a process which produces a lot of output. How would i compress this output on the fly in order to conserve disk space? how would i do this?
 
Old 06-12-2007, 01:34 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Where is it going now?---one big file?

Quick poking around says that you cannot pipe to tar, but you can to gzip.

eg, this works:

cat file | gzip >newfile


So you could pipe the output of your process to gzip, but how would it know when to quit (and close the file)?
 
Old 06-12-2007, 01:36 PM   #3
rrosnowski
LQ Newbie
 
Registered: Jun 2007
Posts: 6

Original Poster
Rep: Reputation: 0
right now i redirect to a file..

./program < /dev/null >> stdout.$(date +%Y%m%d).txt 2>&1
 
Old 06-13-2007, 07:51 AM   #4
rrosnowski
LQ Newbie
 
Registered: Jun 2007
Posts: 6

Original Poster
Rep: Reputation: 0
I think i figured it out.. I created a node file ( fifo ) and then redirect the output to gzip..

mknod pipe.txt p
./program > pipe.txt
gzip < pipe.txt > info.gz
 
  


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirecting socket output to a file elmafiacs Programming 1 10-15-2005 05:18 AM
Redirecting colsole output to file. danimallv Linux - General 4 07-05-2005 02:44 PM
why when redirecting output to a file any file extension seems to be fine? dr_zayus69 Linux - General 1 05-21-2005 04:09 AM
redirecting output of compile to a file halfcan Linux - Hardware 1 02-05-2005 10:01 PM
redirecting cpio screen output to file rawii Solaris / OpenSolaris 1 02-11-2004 09:28 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration