1834814 Members
3171 Online
110070 Solutions
New Discussion

tar options

 
SOLVED
Go to solution
alan_131
Occasional Advisor

tar options

how will i copy my files from a dds tape to my folders in my system(kclass)

is this right?
tar -cvf /to/1
10 REPLIES 10
Shaikh Imran
Honored Contributor
Solution

Re: tar options

Hi,

go to the directory where you want the
file &
#tar -xvf /dev/rmt/0m .

where /dev/rmt/0m = device file of the DDS tape.

Regards.
I'll sleep when i am dead.
Bharat Katkar
Honored Contributor

Re: tar options

Hi,
# cd
# tar xvf

That should work.

Regards,

ps. u can get device file name with
# ioscan -fnC tape
You need to know a lot to actually know how little you know
alan_131
Occasional Advisor

Re: tar options

are my files automatically save to the directory where i want to see them?
Shaikh Imran
Honored Contributor

Re: tar options

hi,

It depends on how you have taken the backup.
if you have used the path as
#cd /test
#tar -cvf /dev/rmt/0m .
then you have to be in that directory OR
you have takne this way
# tar -cvf /dev/rmt/0m /test
then no you don't have to be in that directory.

Regards,


I'll sleep when i am dead.
alan_131
Occasional Advisor

Re: tar options

can i extract all the files w/o specifying any distinct files?
Franky_1
Respected Contributor

Re: tar options

Hi Alan,

if your files are already on the tape and you want to recover them to your system then

go to the FS you want to restore

cd /opt/restore (for example)

and then

tar xfv /dev/rmt/Xm (where X is the device number)

tar cfv is for creating archive
tar xfv is for extracting archive

HTH

Franky
Don't worry be happy
Shaikh Imran
Honored Contributor

Re: tar options

hi,

For your second post :

Yes

But be careful as this will overwrite your existing files

Regards,



I'll sleep when i am dead.
Bharat Katkar
Honored Contributor

Re: tar options

HI Alan

Ques: can i extract all the files w/o specifying any distinct files?

Ans: Yes

# tar xvf /dev/rmt/0m

where i assume /dev/rmt/0m is your dds tape drive.

This will extract all the file in the tape to the current directory. If the backup is taken with absolute path then they will go into thier respective deriectory automatically. You can verify this by:

# tar tvf /dev/rmt/0m
This display the content of tape. If the file are displayed begining with /../.. then it is absolute path or if ./../ then it is relative path.

If you want to restore only specific files from the tape then you have specify the filename at the end of the command like:

# tar xvf /dev/rmt/0m file1 file2 file3 ..

This will restore file1,file2,file3,... etc in the current directory.

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Franky_1
Respected Contributor

Re: tar options

Hi,

just to be curious : What was the difference between Shaiks first and my post (0 and 10 points) ?

Franky
Don't worry be happy
Muthukumar_5
Honored Contributor

Re: tar options

If you want to expand the archieved files then use as like,

tar -xvf

It is good to check the all files in the tap drive as,

tar -tv /dev/rmt/0m

It will list out the files in the tape drive.

You can select the files to extract as,

tar -wxvf /dev/rmt/0m

It will ask user input to extract / not.

# tar -wxvf tt.tar
x rw-r--r-- 0/3 5 Aug 17 16:32 2004 tst.txt: y
x tst.txt, 5 bytes, 1 tape blocks
x rw-r--r-- 0/3 4 Aug 17 16:32 2004 tt.txt: y
x tt.txt, 4 bytes, 1 tape blocks

It will be used to extract easily and in effective mode.
Easy to suggest when don't know about the problem!