1834022 Members
2273 Online
110063 Solutions
New Discussion

Inquiry on tar command

 
Mei Jiao
Respected Contributor

Inquiry on tar command

If I extract only a file from a tar backup tape, would the tar process stops and rewind the tape after that particular file is being restored? Or will it still reading through the end of the tape and only rewind by then?

Is there any way that we could do to stop the tar process continue to read through end of the tape and start rewinding after that particular file is being restored?

Please advice, thanks!
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: Inquiry on tar command

What happens depends on what command line options you use.

What device you use controls the behavior, you can choose a device /dev/rmt/ etetera that will not rewind at all.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mei Jiao
Respected Contributor

Re: Inquiry on tar command

Hi SEP,

Thanks for your reply. However, I have gone through the man page of 'tar', but did not find any option if I want to do this:
- Stop the tar process once it restored the particular file I want to restore, and start rewinding back, instead of it reading through the end of the tape.

I used the normal device file: /dev/rmt/0m

Pls advice again. Thank you!
Nguyen Anh Tien
Honored Contributor

Re: Inquiry on tar command

Hi Mei.
Happy new year.
I think tar can not extract only a file. Check attached file for detail.
You should use cpio command for your purpose.
tienna
HP is simple
Mei Jiao
Respected Contributor

Re: Inquiry on tar command

Hi Tienna,

Well I think 'tar' can restore a particular file.
abhijeet_7
Advisor

Re: Inquiry on tar command

Hi Mei Jiao,
I think tar can extract a single file..
lets try this (not much sure!!)

tar -xvf /dev/rmt/0m /homt/mel/

It will read till end of tape & rewind from there.

let us know

regards
ABHI K



we work, to become...not acquire
Mei Jiao
Respected Contributor

Re: Inquiry on tar command

Yes, I've done a testing myself yesterday. The 'tar' command will read through the end of the whole backup before it rewinds.

I've also tested on fbackup, after frecover restored the file it comes to the prompt much faster than 'tar'.

Thanks!
Ravi_8
Honored Contributor

Re: Inquiry on tar command

Hi,

tar, once find the required file on the tape and extracted it, it runs through the tape to find another such file in the tape if exist( in case of incremental backup the chnages will be extracted). Hence the reason tar will read through end of tape.

If the tape size is bigger (eg. 120GB ...)this process takes longer time. Hence the concept of (NAS) network attached storage. Wherein NAS maintains the database of backedup file, while restoring it check the database for the files to be restored and point to particular tape in the tape library and moves the header to particular block in the tape and read/extract it.
never give up
Thierry Poels_1
Honored Contributor

Re: Inquiry on tar command

hi,

as you can update (read "append") a tar backup, I guess it's quite normal that tar reads the whole backup file to check for newer versions of the same file.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.