Not seeing what is done (?)
|
Original Message
|
Name: LANkrypt0
Date: July 30, 2003 at 11:48:25 Pacific
Subject: Not seeing what is done (?)OS: FreeBSDCPU/Ram: n/a |
Comment: 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?
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: Don Arnett
Date: July 30, 2003 at 13:35:16 Pacific
Subject: Not seeing what is done (?) |
Reply: (edit)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/null
tar 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
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: LANkrypt0
Date: July 30, 2003 at 13:39:48 Pacific
Subject: Not seeing what is done (?) |
Reply: (edit)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/mailtar pine -z mkdir $mroot/mailtar tar cvf $mroot/mailtar/test.tar $(ls /y1/u1/home/jasonp/mail/*) gzip $mroot/mailtar/test.tar So I would basically do a >> /path/file.log 2>&1 for each of those lines?
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: Don Arnett
Date: July 30, 2003 at 13:55:24 Pacific
Subject: Not seeing what is done (?) |
Reply: (edit)>> 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.
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: