LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-02-2006, 11:14 PM   #1
rajeshkahara
LQ Newbie
 
Registered: Nov 2003
Distribution: red hat
Posts: 18

Rep: Reputation: 1
tar problem - Removing leading / from hard link targets


Hi all,

I have a nightly cron job that uses tar to back up directory.
I am using the command

tar –czf directory.tgz /some/directory

Above command gives following error.

tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets


I am not bothered about ‘Removing leading `/' from member names’ but about ‘Removing leading `/' from hard link targets’. I'm concerned that restoring my files will not be successful.
Can anyone help me sorting the issue ? Is it a bug in tar ?

Thanks in Advance.
Rajesh.
 
Old 01-03-2006, 05:40 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

It's nothing serious - tar gives that warning when you tar directories starting with "/".

Think of the senario:
cd ~
tar -czf etc.tgz /etc

Then if you
tar -xzf etc.tgz
should the files be unpacked in /etc? I think not. Thats why tar removes the leading / for all names in the tar file.

To prevent the warning
cd /
tar -czf directory.tgz some/directory

Or you can just
tar –czf directory.tgz /some/directory |grep -v "Removing leading"
 
Old 01-05-2006, 01:33 PM   #3
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

Continue here.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/bin/tar: Removing leading `/' from member names guarriman Linux - General 16 02-09-2010 08:19 PM
Problem with tar - Removing leading `/' from hard link targets rajeshkahara Linux - Software 1 01-03-2006 05:23 PM
Problem with tar - Removing leading / from hard link targets rajeshkahara Linux - Software 4 01-03-2006 04:22 AM
"tar: Removing leading `/'..." - message Lotharster Linux - Newbie 4 12-02-2005 08:41 AM
Strip leading dot in filepaths (in tar archive) EcceVery Debian 2 04-13-2005 07:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration