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
Line 1: Line 1:
# 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.



Revision as of 16:33, 10 June 2023

  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, not it will hinder the reading of log files or trigger the sending of mails.

What you do is pretty simple. 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. 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. :-)