1825810 Members
2547 Online
109688 Solutions
New Discussion

log file for tar command

 
Mohd Esa Abd Kadir
New Member

log file for tar command

When i use tar command, i could not seen a log file for it. There is a script to determine a log file for tar command
5 REPLIES 5
Sanjay Kumar Suri
Honored Contributor

Re: log file for tar command

I don't think tar has a log file. By default it displays the results on the standard output which can be redirected to a file.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Robert-Jan Goossens
Honored Contributor

Re: log file for tar command

Hi,

You could use the -v option and redirect the output to a file.

# tar cvf temp.rjg /tmp > /tmp/tar.log

HTH,
Robert-Jan
Andris Mednis
Advisor

Re: log file for tar command

Hi!

'tar' command doesn't do logging. You can have some imitation of logging by redirecting
'tar' messages to a file:
$ tar cvf myarchive.tar file1 dir2 > mypacking.log 2>&1
$ tar xvf myarchive.tar file1 dir2 > myunpacking.log 2>&1

V.Tamilvanan
Honored Contributor

Re: log file for tar command

Hi,

Default there is no log file for tar. But you can redirect the output to a file like below.

#tar -cvf /dev/rmt/1m /tmp 2>/tmp/tar.log


KapilRaj
Honored Contributor

Re: log file for tar command

You can use tee also .

tar cvf tar.tar . |tee /tmp/log_tar

Regds,

Kaps
Nothing is impossible