Already on GitHub? Sign in to your account. The text was updated successfully, but these errors were encountered:. Ah so --dereference is just for when the tar is created, not for extraction. Also, the error message from the first invocation isn't quite as bad as it looks -- the extraction didn't abort halfway through, there were just a small number of skipped files.
It appears that GNU tar for at least the MSYS2 package of it does partially handle filesystems that don't support symlinks, in that whilst extracting it does replace the symlink with a copy of the full file, if the file already exists on the filesystem.
The problem with this is that it's dependant on the order of the files in the tar, since if the symlink is extracted first, the target won't yet exist this isn't a problem on linux since dangling symlinks are allowed. This comes from the fact that tar is intended as a streaming format, though perhaps GNU tar should still try and do the right thing when in seekable mode but fixing GNU tar is beyond the scope of this ticket.
As such, a workaround is to run the tar extraction multiple times, which will eventually succeed without errors once all the symlink targets have been created. Active Oldest Votes. Use the -h tar option. From the man page: -h, --dereference don't archive symlinks; archive the files they point to.
Improve this answer. Mat Mat FelipeAlvarez -L counts files once, -l multiple times. See here. Doesn't work here. Sign up or log in Sign up using Google. Sign up using Facebook. The time now is AM. Twitter: linuxquestions. Open Source Consulting Domain Registration. Search Blogs.
Mark Forums Read. Tar and symlinks. User Name. Remember Me? Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game. Tar and symlinks I want to save a directory that has one or more symlinks without all the files that the symlink s point to ie I don't want to follow the symlinks.
View Public Profile. View Review Entries. Find More Posts by Johng. Find More Posts by gilead. Find More Posts by MensaWater. Featured on Meta. Now live: A fully responsive profile. Candidate changes in Moderator Election — review your ballot. Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled.
Accept all cookies Customize settings.
0コメント