Results 1 to 4 of 4
Hello all linux folks.
Here's my story.
I am trying to backup my entire linux machine as a root user with the following command:
tar cpjf /media/USB-DRIVE/ubu_091008.tar.bz2 --directory=/ \
--exclude=media ...
- 10-09-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 2
tar Removing leading from member names
Hello all linux folks.
Here's my story.
I am trying to backup my entire linux machine as a root user with the following command:
tar cpjf /media/USB-DRIVE/ubu_091008.tar.bz2 --directory=/ \
--exclude=media \
--exclude=proc \
--exclude=lost+found \
--exclude=mnt \
--exclude=sys \
--exclude=tmp \
--exclude=home/user01/.gvfs \
/ 2>/media/USB-DRIVE/ubu_091008.log
When doing that I see 2 lines in my log file:
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
I have tried to find anything on this topic searching using "Find the answer to your Linux question:" box, but there were 0 found. (I have used "tar Removing leading from member names" as search text)
Could anyone, please, help me to determine the meaning of these 2 lines?
Regards,
vladimir.
- 10-09-2009 #2Linux Newbie
- Join Date
- Jan 2008
- Location
- Canada
- Posts
- 109
Hi voleynik
You could try removing the '/' after '--directory=' ie it might read '--directory= \' instead of '--directory=/ \' .
If you wish to retain leading \ (slash) use Option :
-P, --absolute-names
don’t strip leading ‘/’s from file names
Not sure if the tar performed OK or not for you and not exactly sure what you are trying to accomplish but these might help. Cheers...
Robert
- 10-09-2009 #3Just Joined!
- Join Date
- Oct 2009
- Posts
- 2
tar error messages
Hello Robert.
Thanks a lot for your reply.
Here are some clarifications about my command.
The backslash "\" is only there for breaking the long command into 9 lines for clarity.
The tar command finished OK.
Here what I am trying to accomplish in plain English:
~ Create a arc-zip file ubu_091008.tar.bz2 in directory /media/USB-DRIVE
~ Before doing anything execute "cd /" command ( --directory=/ ).
~ Exclude the files and directories listed in --exclude= section ( lines 2-
~ Archive and zip root directory ( / on line 9 ).
~ Record errors into /media/USB-DRIVE/ubu_091008.log file (line 9).
So, please let me know if you still not sure what I am trying to accomplish.
And my question is about these 2 erroe lines in a log file:
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
What exactly these lines are referring to?
Regards,
vladimir.
- 10-12-2009 #4Linux Newbie
- Join Date
- Jan 2008
- Location
- Canada
- Posts
- 109
Hi vladimir
Try the following command in lieu of what you had.
in place of what you had {tar cpjf /media/USB-DRIVE/ubu_091008.tar.bz2 --directory=/ \}. The leading '/' in front of media is unecessary, I believe. NOTE: the slash I have put after the -C has spaces around it and is not part of the destination directory <media/USB-etc etc>. This is the source of your sderr messages.Code:tar cpjf -C / media/USB-DRIVE/ubu_091008.tar.bz2 --directory=/ \
The '-C /' just changes the current directory to '/ before it does the tar . The elimination of the leading '/' on the destination should eliminate the Error messages going to your log (sterr redirected in your case). You should also not put a '/' at the end of sources nor destinations (directories) or you will probably get similar errors. You in fact did not have a trailing '/' so it does not create a warning for trailing '/'s. Apart from the error messages the results will be identical. Tar is just smart enough to warn you of what it is doing and does the correct thing anyway.
Apparently '/' is a relative marker to <tar> and not seen as root designation. I have not studied your entire command but I think all of the --excludes etc. should not need to be changed in any way. Hope this helps in some way. Cheers...
Robert


Reply With Quote
