How can I copy files and directories without overwriting the existing metadata on the target? I have configuration files in a repository that configure the system. The source files are owned by a regular user, but the target has files owned by other users including root.
When running ls -l later, I see that the permissions on a file that was owned by root is now owned by myself.
I tried omitting -p from both creation and extraction as well as --no-same-permissions and --no-xattrs, but it still ends up overwriting the permissions. I can do a chown and chmod later, but was hoping there was a better way to do that.
I just want to update the contents of the files. For any files that do not already exist, I will have to chmod/chown them.
tar cf - . | tar xf - -C ../extract
When running ls -l later, I see that the permissions on a file that was owned by root is now owned by myself.
I tried omitting -p from both creation and extraction as well as --no-same-permissions and --no-xattrs, but it still ends up overwriting the permissions. I can do a chown and chmod later, but was hoping there was a better way to do that.
I just want to update the contents of the files. For any files that do not already exist, I will have to chmod/chown them.