Untar to a particular directory is Failing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Untar to a particular directory is Failing
# 8  
Old 07-18-2017
Tools

Quote:
Originally Posted by vgersh99
tar -xvf bent.tar -C /web/applications/configurations
and the path /web/applications/configurations exists AND has the proper permissions?
Try untarring it under a diff directory - say /tmp
File permissions is also not the issue here ....

I even tried extracting it to /tmp but its not working.

I can even make a video demonstration and share the link here if you would like ?

---------- Post updated at 11:44 AM ---------- Previous update was at 11:28 AM ----------

See this output. Not sure why is it failing.

Code:
bash-3.2$ tar -xvf bent.tar -C /tmp/
bash-3.2$ echo $?
0
bash-3.2$ ls -ltrd /tmp/bent
/tmp/bent: No such file or directory

I even tried

/usr/sbin/tar instead of /usr/bin/tar but it still does not work

Last edited by mohtashims; 07-18-2017 at 01:53 PM..
# 9  
Old 07-18-2017
Can you post the tar version? Is it GNU tar?
Code:
tar --version

Is that a SunOS VM on a Mac (as per your uname -a output)?

Does the target directory have enough space? (Maybe it's on a separate drive?)

Somehow it seems that the size of the tar file (228 MB) could be an issue, but don't know why or how.
# 10  
Old 07-18-2017
Quote:
Originally Posted by durden_tyler
Can you post the tar version? Is it GNU tar?
Code:
tar --version

Is that a SunOS VM on a Mac (as per your uname -a output)?

Does the target directory have enough space? (Maybe it's on a separate drive?)

Somehow it seems that the size of the tar file (228 MB) could be an issue, but don't know why or how.
Here is the information you requested.

Code:
bash-3.2$ df -k /tmp
Filesystem            kbytes    used   avail capacity  Mounted on
swap                 15585680 1294448 14291232     9%    /tmp
bash-3.2$ uname -a
SunOS mymac 5.10 Generic_150400-40 sun4v sparc sun4v
 bash-3.2$ tar --version
tar: s: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@[0-7]][bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...

if size of the tar is the issue then why does copying the bent.tar to /tmp and then -> tar -xvf bent.tar work ??

Last edited by mohtashims; 07-18-2017 at 02:12 PM..
# 11  
Old 07-18-2017
What's the output of "tar --version"?

Edit: Ok, I see that it's not GNU tar; doesn't understand the long version of qualifiers.
I can test it on my Solaris VM later, but as of now I don't why copying the bent.tar to /tmp and the "tar -xvf bent.tar" work.
# 12  
Old 07-18-2017
Tools

Quote:
Originally Posted by durden_tyler
What's the output of "tar --version"?

Edit: Ok, I see that it's not GNU tar; doesn't understand the long version of qualifiers.
I can test it on my Solaris VM later, but as of now I don't why copying the bent.tar to /tmp and the "tar -xvf bent.tar" work.
It works when I do not give the -C option.

See the output below:

Code:
bash-3.2$ cp bent.tar /tmp
bash-3.2$ cd /tmp
bash-3.2$ tar -xvf bent.tar
x bent, 0 bytes, 0 tape blocks
x bent/002, 0 bytes, 0 tape blocks
x bent/002/LEGAL, 0 bytes, 0 tape blocks
x bent/003, 0 bytes, 0 tape blocks

Any solution will be appreciated.
# 13  
Old 07-18-2017
Out of sheer curiosity, reg. post#10: does it make sense to mount a swap file system to /tmp (where tar might store intermediate data)?
# 14  
Old 07-18-2017
Tools

Quote:
Originally Posted by durden_tyler
What's the output of "tar --version"?

Edit: Ok, I see that it's not GNU tar; doesn't understand the long version of qualifiers.
I can test it on my Solaris VM later, but as of now I don't why copying the bent.tar to /tmp and the "tar -xvf bent.tar" work.
Tar version

Code:
bash-3.2$ which tar
/usr/bin/tar
bash-3.2$ strings /usr/bin/tar | grep -i version
tar:  file # %llu: (%s) UTF-8 conversion failed.
tar: conversion routines not available for current locale.
file # %llu: (%s) UTF-8 conversion failed.
tar:  file # %llu: (%s) UTF-8 conversion failed.
tar:  file # %llu: (%s) UTF-8 conversion failed.
tar:  file # %llu: (%s) UTF-8 conversion failed.
tar: file # %llu: UTF-8 conversion failed.
tar: conversion routines not available for current locale.
file (%s): UTF-8 conversion failed.
tar: file (%s): UTF-8 conversion failed.
tar: invalid character in UTF-8 conversion of '%s'
tar: invalid character in UTF-8 conversion of '%s'
tar: conversion to UTF-8 aborted for '%s'.
tar: invalid character in UTF-8 conversion of '%s'
tar: conversion to UTF-8 aborted for '%s'.
bash-3.2$ file /usr/bin/tar
/usr/bin/tar:   ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
bash-3.2$ tar --version
tar: s: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPqTvw@[0-7]][bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...

---------- Post updated at 12:52 PM ---------- Previous update was at 12:37 PM ----------

Quote:
Originally Posted by RudiC
Out of sheer curiosity, reg. post#10: does it make sense to mount a swap file system to /tmp (where tar might store intermediate data)?
You mean copy and untaring the bent.tar inside /tmp and then moving it to the desired destination location ?

That will be the last option if -C looks like too difficult or a bug.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Untar tar.gz to particular directory

Hi Guys, I am able to untar a tar.gz file. But it is again extracting the tar file to further child directory. I even tried the below command to untar it to particular directory. tar -zxvf gme_dly_sls_20120515035335.txt.tar.gz -C /sites/VSTAR/site/live/ftp/GMEUROPE I am getting the below... (4 Replies)
Discussion started by: mac4rfree
4 Replies

2. Solaris

Unable to Untar

Hello, bash-2.05# tar -xvf sunos.tar tar: directory checksum error bash-2.05# file sunos.tar sunos.tar: data bash-2.05# Can someone please help me untar this. This is a Solaris 9 box. (5 Replies)
Discussion started by: zigi_p5
5 Replies

3. Solaris

zip -r <directory> failing due to 2GB limit - Just asking opinion

Hi, Am trying to run zip -r on a 2.4G directory and it is failing with the error below. I believe this is because of the 2G limit of the zip program. server101(oper01)/u01/temp$: date Thu Mar 15 12:53:44 NZDT 2012 server101(oper01)/u01/temp$: ls -l total 8 drwxr-x--x 4 oracle dba ... (1 Reply)
Discussion started by: newbie_01
1 Replies

4. Shell Programming and Scripting

Untar specific directory and strip leading directories

Ok so I know the title was probably confusing so here goes: I have a tarball (gzipped) that has a nested directory structure . For example: my.tar.gz (contents) --- ------ --------- ------------ --------------- ... (2 Replies)
Discussion started by: DC Slick
2 Replies

5. Shell Programming and Scripting

cp, chown, untar

hello i want shell script. i have a source.txt /home/user409/public_html/test/ /home/user09876/public_html/xdsss/ /home/user9765/public_html/320xxx/ . . . maybe 1000 lines i want . 1.read a source.txt 2.untar special.tar.gz into these directory in source.txt 3.i want to... (14 Replies)
Discussion started by: topic32428285
14 Replies

6. AIX

untar

Hi, How can i untar a set of files in to different directory. This is content tar -tvf samba.tar drwxrwxrwx 0 0 0 Nov 28 18:35:41 2008 samba/ -rw-r--r-- 0 0 0 Nov 18 15:12:40 2008 samba/b.txt -rw-r--r-- 0 0 0 Nov 18 15:12:40 2008 samba/c.txt -rw-r--r-- 0... (4 Replies)
Discussion started by: allwin
4 Replies

7. Programming

Not able to use NFS mounted directory as buffer for untar & unzip.

Hi, For a new requirement, we are trying to use NFS mounted directory as the buffer (TMP_DIR) for untar. Target OS- VxWorks Host OS - Windows Embedded. mounted a directory in wondows onto VxWorks. During untar process of GNU we come across utime, for chaning the time stamp of the... (0 Replies)
Discussion started by: suraj.bc
0 Replies

8. UNIX for Dummies Questions & Answers

Untar problems

Hi, I am new to unix scripting. I have written a java program which will initialize a sftp connection and copy a unix script from my machine to a remote server. Then i initalized an ssh connection and i executed the script. This script contains a sequnece of commands and one of them is to... (2 Replies)
Discussion started by: vinothg
2 Replies

9. UNIX for Advanced & Expert Users

untar

i have try to untar the file in same location. But it gave the error # tar -xvf TSMSRVAIX5220.tar x tivoli.tsm.devices.acsls, 757760 bytes, 1480 media blocks. tar: 0511-169 A directory checksum error on media; 4011 not equal to 8222. How can i rectify this prob. Thanks in advance ... (2 Replies)
Discussion started by: prakash96453
2 Replies

10. UNIX for Dummies Questions & Answers

How can you UnTar files to a different directory?

Suppose you have a TAR file created with a different directory structure and you need to UnTar (or explode) the files to a different directory structure. How can this be done? If TAR command cannot do this, are there any other alternatives (any other command) available to UnTar a .Tar file? ... (1 Reply)
Discussion started by: joshivaibhav
1 Replies
Login or Register to Ask a Question