tar problem


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users tar problem
# 1  
Old 03-11-2005
tar problem

I am using a tar command to backup my system. It works properly.

I have had some trouble and I need to restore a few files.

I am using the following command :

tar xvf /dev/rmt2h myfile_to_restore

The tar command seemd to work but after a long time I got the following error message :
tar: /dev/rmt2h : this doesn't look like a tar archive
tar: /dev/rmt2h : Skipping to next file...
tar: Memory allocation failed for extended data while reading : Invalid argument.

If I am using the command
tar xvf /dev/rmt2h
without any procision of a specific file, then it works and extract everything ... But I just would like to extract a few files...

Any idees?
I am working on True64 Unix V4.0e
Thanks
# 2  
Old 03-11-2005
Shouldnt there be a / after rmt. /dev/rmt/2h ?
# 3  
Old 03-14-2005
Quote:
Originally Posted by ridgeback00
Shouldnt there be a / after rmt. /dev/rmt/2h ?
No the command
tar xvf /dev/rmt2h is correct and has always worked. The problem is linked to the fact that I speciified a file to extract. I don't anderstand why the tar command failed with such message.

If anyone has other ideas?
Thanx
# 4  
Old 03-14-2005
Why not extract the tar file into somewhere like /tmp then just grab the file you want?
# 5  
Old 03-15-2005
That's what I am doing, but as I have not enough space on my disk to restore the whole backup I have to watch all the restore to delete the files I don't need.
It is a little tedious, and I can't restore the files I want during the night for example.
# 6  
Old 03-15-2005
Try
tar --extract --file=nameoftar.tar name_of_file_to_extract
# 7  
Old 03-18-2005
Quote:
Originally Posted by thumper
Try
tar --extract --file=nameoftar.tar name_of_file_to_extract
This syntax does not work.
It is either tar xf ... or tar -xf (which is an old syntax which will not be supported in the future).

But, I think i found the problem. It was a question of naming the "file_to_extract". It must be exactly as it has been named in the tar file. I though that I could say
tar xf /dev/rmt2h my_file_to extract
even if in the backup the file was backed up as ./my_file_to extract

So now, if I type :
tar xf /dev/rmt2h ./my_file_to extract
it works ...
Thanks to all of you who tried to help me
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

2. Ubuntu

Problem with tar

Hello everyone, I´ve got a problem when I try to untar a file. The following errors appear: tar: Skipping to next header tar: Skipping to next header tar: Exiting with failure status due to previous errors Can anyone help me? Thanks in advance! (1 Reply)
Discussion started by: katkat
1 Replies

3. Linux

tar problem

can someone help me here. apparently, the colon i included in the name of this file is making it difficult for tar to untar it. please help ####### tar xvf DailyConfigs_Nov-19-11\:00-2009.tar rsh: DailyConfigs_Nov-19-11: Name or service not known tar: DailyConfigs_Nov-19-11\:00-2009.tar:... (4 Replies)
Discussion started by: SkySmart
4 Replies

4. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

5. Shell Programming and Scripting

problem is tar

i have some 685 files in my directory.Below the count: find . -name "CurrentCollectorMeterReadBackup_2009*" -exec ls -ltr {} \; | wc -l 685 i want to tar them but it is telling me arg list too long. how to tar all this files in one shot tar -cvf - -L... (1 Reply)
Discussion started by: ali560045
1 Replies

6. UNIX for Dummies Questions & Answers

Tar problem

I've done a tar -cvf data.tar * in our live data directory on a Solaris machine. I copy the tar file to the test area and try tar -xvf data.tar . and it uses the full path in the tar file and overwrites the live ones again. I've used tar many a time and don't understand why its happening.... (1 Reply)
Discussion started by: kinhell
1 Replies

7. Shell Programming and Scripting

tar doubts - problem with tar

The below tar command works fine for me, tar -cvf - `find ./srcdir -type d` | (cd ./destdir ; tar -xvf - ) but this version is giving error to me: cd ./srcdir && tar -cf - . | gzip -9 | cd ../destdir && gzip -d | tar -xf - error is: gzip: compressed data not read from a terminal.... (2 Replies)
Discussion started by: royalibrahim
2 Replies

8. UNIX for Advanced & Expert Users

tar problem

Can someone please verify for me if tar compresses the directory or filesystem it is asked to back up?? reason am asking is I checked the size of the /home directory before running a tar command now, after I ran the tar command and the tar was done extracting the directory from the archive, I... (2 Replies)
Discussion started by: TRUEST
2 Replies

9. UNIX for Advanced & Expert Users

tar problem

hi , On AIX 4.3.3 I typed the following command tar -cvf <filename> ( actually I forgot to type the device name) the output was change in the file size to 10240 bytes I tried tar -xvf to extract the same but file size is same. The file was "txt" file and was readable before the... (2 Replies)
Discussion started by: amit
2 Replies

10. UNIX for Dummies Questions & Answers

Tar Problem

I need to do a bakcup for some files, in the same tape but in diferente time.... at 9am i need the file /public/test1.txt then... tar -cvf /dev/st0 /public/test1.txt at 12pm i need the file /public/test2.txt the.... tar ¿? /public/test2.txt in this point i have problem beacuse when... (3 Replies)
Discussion started by: sokobans
3 Replies
Login or Register to Ask a Question