I'm trying to back up some key files and directories of a machine, as root, including some of the /home data, hand-picking some files to reduce the tarball size. Everything is OK for the most part, since most files are owned by root anyway, but say I just try this:
# tar -cf backup.tar /home/user/file
When I restore the contents, /home/user/file is as expected owned by user, but /home/user is owned by root. I tried, however,
# tar -cf backup.tar /home
and in this case all /home owners are preserved. (Note that I don't need the -p flag as I'm root. Still I tried it...)
Is this normal behavior? If so, is there a way to hand-pick regular-user files to back up while keeping the /home ownership information? My goal is to simply untar everything from /.
Thanks!