Apr 24, 2003 #1 Michael42 Programmer Joined Oct 8, 2001 Messages 1,454 Location US How can I send the output of a tar listing to a log file? I tried this and a few variations: tar -tvf /dev/rmt/0 2>> tar.log The results are that it creates a 0 byte file. What can you suggest? Thanks!
How can I send the output of a tar listing to a log file? I tried this and a few variations: tar -tvf /dev/rmt/0 2>> tar.log The results are that it creates a 0 byte file. What can you suggest? Thanks!
Apr 24, 2003 #2 KenCunningham Technical User Joined Mar 20, 2001 Messages 8,475 Location GB You're copying standard error only to your file. Get rid of the 2, ie: tar -tvf /dev/rmt/0 >> tar.log The >> also appends. If you just want to create and overwrite each time use just one > HTH. Upvote 0 Downvote
You're copying standard error only to your file. Get rid of the 2, ie: tar -tvf /dev/rmt/0 >> tar.log The >> also appends. If you just want to create and overwrite each time use just one > HTH.
Apr 24, 2003 Thread starter #3 Michael42 Programmer Joined Oct 8, 2001 Messages 1,454 Location US Ken, thanks your suggestion worked great! Upvote 0 Downvote
Apr 24, 2003 #4 iribach Technical User Joined Oct 12, 2002 Messages 211 Location CH if you collect also error: tar tvf /dev/rmt/0 >> tar.log 2>&1 nota: tar does not care about '-' in options-string Upvote 0 Downvote
if you collect also error: tar tvf /dev/rmt/0 >> tar.log 2>&1 nota: tar does not care about '-' in options-string