Don't want "tar: Removing leading `/' from " message: Difference between revisions

From Andreida
(Created page with "# This is not an error nor a warning, this is an information. # You do not want to change the behavior, because this is good, you do not want absolute paths in your archive....")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== info ===
# This is not an error nor a warning, this is an information.
# This is neither an error nor a warning, this is an information.
# You do not want to change the behavior, because this is good, you do not want absolute paths in your archive.
# You do not want to change the behavior, because this is good, you do not want absolute paths in your archive.


What you normally want it to just not see this information - after you understood it - because it can, not it will hinder the reading of log files or trigger the sending of mails.
What you normally want it to just not see this information - after you understood it - because it can, no it WILL hinder the reading of log files or trigger the sending of mails.


What you do is pretty simple.
What you do is pretty simple.

=== Original example still with the "fix" and the info about it ===
Imagine you have the following command:
Imagine you have the following command:
tar zchf /var/db-dump/your-name-1-images.tgz /var/www/wiki.your-wiki-1/images/
tar zchf /var/db-dump/your-name-1-images.tgz /var/www/wiki.your-wiki-1/images/
Line 13: Line 16:
or something like that.
or something like that.
It is good to know that this is happening but you now really don't want to see these lines.
It is good to know that this is happening but you now really don't want to see these lines.

=== Solution ===

You just use the "-C <directory> option to first switch directories and then use tar with a relative path:
You just use the "-C <directory> option to first switch directories and then use tar with a relative path:
tar zchf /var/db-dump/your-name-1-images.tgz -C / var/www/wiki.your-wiki-1/images/
tar zchf /var/db-dump/your-name-1-images.tgz -C / var/www/wiki.your-wiki-1/images/


And nope, I am not fucking with you. Two characters and a space and you are good to go. :-)
And nope, I am not fucking with you. Two characters and a space and you are good to go. :-)



Btw, we are NOT supressing the information or something, we change what we do so there is no need to "fix" the archive and remove leading slashes.

Latest revision as of 16:39, 10 June 2023

info

  1. This is neither an error nor a warning, this is an information.
  2. You do not want to change the behavior, because this is good, you do not want absolute paths in your archive.

What you normally want it to just not see this information - after you understood it - because it can, no it WILL hinder the reading of log files or trigger the sending of mails.

What you do is pretty simple.

Original example still with the "fix" and the info about it

Imagine you have the following command:

tar zchf /var/db-dump/your-name-1-images.tgz /var/www/wiki.your-wiki-1/images/

This will give you the information

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

or something like that. It is good to know that this is happening but you now really don't want to see these lines.

Solution

You just use the "-C <directory> option to first switch directories and then use tar with a relative path:

 tar zchf /var/db-dump/your-name-1-images.tgz -C / var/www/wiki.your-wiki-1/images/

And nope, I am not fucking with you. Two characters and a space and you are good to go. :-)


Btw, we are NOT supressing the information or something, we change what we do so there is no need to "fix" the archive and remove leading slashes.