Linux Tar Getting Removing Leading `/' From Member Names When Executed



Linux Tar Getting Removing Leading `/' From Member Names When Executed
Linux Tar Getting Removing Leading `/' From Member Names When Executed
Post Description:
Post Tags: linux, tar, getting, removing, leading, from, member, names, when, executed
This Post Has Been Viewed 5241 Times Since Sat Jan 13, 2007 3:58 pm Posted By pinguin with 5 replies
Next Post »» Open Unpack Unzip Uncompres .gzip .gz .gunzip Files In Linux Shell Command
Linux Tar Getting Removing Leading `/' From Member Names When Executed
hi, can anyone helpme, when i send the tar command, i get this:


     Code:
Removing leading `/' from member names


when i look at my directory, i see that the tar has been created, but i was wondering if this is going to cause a problem when i try to untar it since this is going to be a back up file and if there any goes wrong, i want to make sure i am doing it right. not sure if i executed incorectly on my linux server.

thanks

Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About Linux Tar Getting Removing Leading `/' From Member Names When Executed




:: 1 :: #854 - Reply By Gonatan On Fri Mar 16, 2007 6:09 am
Just found this: https://forum.bytemark.co.uk/viewtopic.php?pid=1937

This may help you with your question
:: 2 :: #897 - Reply By brando On Sat Mar 17, 2007 7:27 pm
this is what that post says:

he "Backup Ideas" page[1] has an example shell script meant to be executed as a daily cron job.




That example includes an invocation of the tar command like this:



tar cj /etc /home/ /usr/local > $PREF-$$.tar.bz2



If you run a script containing a tar invocation of that form, you'll notice that root will get an e-mail message every time the script runs, with stderr warnings from the tar command saying "Removing leading `/' from member names".



You can eliminate those tar warnings by instead invoking the tar command like this:



tar cj -C / etc home usr/local > $PREF-$$.tar.bz2



The effect will be the same except that tar will no longer emit the "Removing leading `/' from member names" warnings to stderr -- because the -C option and slash argument tell tar to cd to the root directory before tarring up whatever directories or files are specified in the rest of the arguments list.



So you'll no longer get the unnecessary mail from that cron job -- you'll only get mail if something has actually gone wrong with the job.
:: 3 :: #59405 - Reply By mindelini On Thu Jun 26, 2008 11:15 am
thank you. very helpful.
:: 4 :: #60303 - Reply By stevee On Fri Jul 04, 2008 6:45 am
hi,
this is normal for tar, the / is a relative directory boundary in the tree structure, and tar is aware and will replace them correctly when untarring - you should test your backup anyway before relying on it, on a spare partition or pc and check it untars correctly using
#tar -xvf filename.tar
you can list the files in the tarball without untarring them as a rough check maybe if its not to big to read or your fastidious..
#tar -tvf file.tar where -t is "list", -v "verbose" -f "file" -x " extract
also read the man pages on commands you use: #man tar
cheers
stevee
:: 5 :: #67912 - Reply By A Person On Sun Aug 24, 2008 4:31 am
try:
tar czf /tmp/myarchive.tar.gz -c / etc home

apparently the order is sometimes important :-)