tar: Removing leading `/' from member names
It might be best to leave your files without the '/' in the backup and just ignore the error message. Tar does this as a safety precaution, because if you untar the file, it will automatically place the files back in the original directory. This can be dangerous and most people want to avoid this. Personally, I would be happy with the fact that it removed the '/' and then your restore will be relative and not absolute directory path. Then you can manually move the files into the right place, or a different place. Just posting this so people are aware and don't inadvertently replace their original files.
This is because your file ($kname
) has leading /
.
To fix that, you may specify -C
to change the directory, instead of specifying full path of the archive file.
The "good" version is also displaying the same message you've just missed it.
If you don't like the behaviour, search for "leading", in manual. First hit:
-P, --absolute-names
don't strip leading '/'s from file names