Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I use pine for mail, but my folders started getting huge, so I made a simple little script to tar/gzip all the files when I exit pine and then untar/gunzip when I am going in to access everything. My only problem is that I am seeing what is going on and I would like that stuff hidden so its not visible.
Any suggestions?

Do you mean that you are seeing the output from the tar command, ie the list of all of the files being tarred/untarred??
If so, just redirect the output to /dev/nulltar zcvf blah * >/dev/null 2>&1
This redirects both stdout and stderr to the bit bucket (nowheresville)
Or if you'd like to have the output saved somewhere:tar zcvf blah * >>/mydir/myfile.log 2>&1

Thats exactly it, the output from tar and rm and gzip. Perhaps Ill keep a logfile of this stuff so I can view it for errors.
Same thing for each command?
actual code:gunzip $mroot/mailtar/test.tar.gz
tar -xvf $mroot/mailtar/test.tar
rm -rf $mroot/mailtarpine -z
mkdir $mroot/mailtar
tar cvf $mroot/mailtar/test.tar $(ls /y1/u1/home/jasonp/mail/*)
gzip $mroot/mailtar/test.tarSo I would basically do a >> /path/file.log 2>&1 for each of those lines?

>> means append
> means start a new output file
2>&1 means send stderr to same place as stdout
I'd suggest outputting the date and then appending each commands output to the same file:date >/path/file.log 2>&1
gunzip $mroot/mailtar/test.tar.gz >>/path/file.log 2>&1
tar -xvf $mroot/mailtar/test.tar >>/path/file.log 2>&1
rm -rf $mroot/mailtar >>/path/file.log 2>&1
Note the single > after the date command, this will cause the file to be overwritten each time. If you don't want that you could change that to a double >> also.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |