I'm creating a tar file from a list of files with the -T option. When extracting the tar file, subdirectory permissions are root:root instead of the permissions on the directory itself? Any ideas how to fix this?
Example:
# cat filelist.txt
file1.txt
dir1/file2.txt
dir1/dir2/file3.txt
# tar cf files.tar -T filelist.txt
# tar xf files.tar
Ownership on extracted files match original ownership on file1.txt, file2.txt, and file3.txt Ownership on dir1 and dir2 does not match. Owner is root:root
I could follow a solution similar to Preserve ownership & rights of parent directory when extracting tar archive but was hoping there was another way as that might add up to some more work for a bunch of directories.