I have two tar files which are basically backups of my /data folder on android. The problem is the permissions and ownership of the files inside latest back-up is messed up. However the permissions in older tar is perfect.
I want a way to read permissions from old.tar and copy over the changes to latest.tar.
I tried extracting files to my own system using -p and --same-owner flag but the ownership changes to
root instead of
system because my computer doesn't have a user or group called system but my android phone does. I thought I'd extract the files, and write a script which uses stat and grep to read permissions and ownership and sets the permissions and ownerships of the files in latest.tar. But it doesn't seem to work that way. Can anyone give me some help on this issue.