Hi, What I want is that existing directories don't get their owner/group/permissions changed, but non-existing ones get created as they are in the archive. All non-directories (files, hard links) should extract, and if existing files with the same path are there they get overwritten.
This is part of a very low-tech packaging system for software where the archive gets unpacked at the root and should not modify existing directories ownership or permissions, but directories that are new (not existing on live system but in the archive) get created as needed. All files and hard links should be extracted, and if they already exist they get replaced. Archives do not have any symlinks or devices in them (those are created with scripts if needed). So I'm looking for a combination of options that says extract files/hardlinks no matter what, create directories if they don't exist using owner/group/perms from archive, but don't ever change an existing directory, and don't give errors if existing directory is different than in archive (just quietly use existing directory). On 5/20/16, Sergey Poznyakoff <[email protected]> wrote: > Hi Somchai, > >> To achieve the goal of being able to unpack archives on top of a live >> filesystem but not alter existing system directories, > > Just to make sure I understand the goal correctly: while extracting the > archive, tar should omit content of directories that already exist on > the filesystem? E.g., if there is a directory /foo (with no files in > it) and the archive contains files /foo/bar and /foo/baz, these files > should not be extracted. Is that what you need? > > Regards, > Sergey >
