Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tar and absolute paths

Status
Not open for further replies.

ytakbob

Programmer
Jul 20, 2000
105
US
I am using tar -cvf dog.tar /tmp
I receive the following message before the files are successfully backed up:
tar: Removing leading / from absolute path names in the archive

I DO NOT want tar to remove the leading "/".

How can I prevent this ?

Thanks
Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
Are you using gnutar ? Or is this standard AIX tar ?

Try "tar -cvf dog.tar /tmp/*"

Bill.
 
I am using AIX tar and tried what you suggested
tar -cvf dog.tar /tmp/*

tar is still stripping off leading "/".

I did a tar tvf to confirm that it is in fact, stripping
off leading "/"...it is.

???? Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
Are you in "/tmp" ? If so, either put the tar file somewhere else, or "cd" out of "/tmp".

What oslevel are you ?

Bill.
 
oslevel 4.3.2
$ cd /
$ tar -cvf /Arc/dog.tar /tmp/c*
tar: Removing leading / from absolute path names in the archive
tmp/c
tmp/c.bin
tmp/cain2.bin
tmp/cain2o.bin
tmp/cc.bin
tmp/cdco.bin
tmp/cerner.bin
tmp/cernerr.bin
tmp/cernxx.bin
tmp/ch_cerner.bin
tmp/chcancels.bin
tmp/chk999.bin
tmp/con
tmp/con.bin
tmp/con2.bin
tmp/cons.bin
tmp/core
tmp/cr.bin
tmp/cult.bin
tmp/curn.bin
tmp/cutlures.bin

I don't think it has to do with current directory.
The above tar created while in root directory and tar'd to
/Arc. Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
Does your ID have access to the /Arc filesystem/directory ? Try the same command as root, or send the tar file to another directory.

I'm starting to graple at straws.

Bill.
 
tried as root...same thing..... :-/ Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
Bob,
Looking at the data you want copy,"/tmp/, it was root directory component, so you have the command as root (#)
# tar -cvf dog.tar /tmp
it means : copy /tmp data as dog.tar file name in the same directory

lamrs@yahoo.com
 
try tar -cf //tmp # /////=//=/
or use pax to create the tar ball
 
tar and cpio are compatible use cpio -oBvdc (B = block 5120 c= ascii header)
 
This is indeed very strange behaviour for the tar command.
Send me the output of:
echo $PATH
whereis tar
ls -l [output of above command]
ls -l /usr/bin/tar
lslpp -l|grep free
 
jonh2001 -
tar cvf /dev/rmt0 /tmp
tar: Removing leading / from absolute path names in the archive
tmp/
.
.
.

lamrs
tried taring files from one directory to a file in another...same result. I am simply giving an example of what I am trying to do normally from multiple diectories to tape. My example I posted was for simplicity.

francs:
echo $PATH
/hci/root3.7.1P/hmistst/bin:/hci/root3.7.1P/hmistst/scripts:/hci/root3.7.1P/bin:
/hci/root3.7.1P/contrib:/hci/bin:/hci/root3.7.1P/dbms/bin:/hci/root3.7.1P/tcl/bi
n:/hci/root3.7.1P/clgui/bin:/hci/root3.7.1P/clgui/java/bin:/hci/usercmds:/usr/bi
n:/etc:/usr/sbin:/usr/ucb:/home/ui05052/bin:/usr/bin/X11:/sbin:.:/hmu/scripts:/h
mu/scripts/hciscripts:/usr/lib/learn:/usr/local/bin

$ ls -l /usr/bin/tar
-r-xr-xr-x 1 bin bin 41168 Aug 17 1998 /usr/bin/tar


lslpp -l (do you really want a listing of all my software?)
$ lslpp -l | grep free
$ (nothing)


Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top