Preserve the ownership
After I gzip a file , then gunzip the file , the owner will be changed to me , how can I preserve the ownership to the original owner.
# ll abc.prn
-rw-rw-rw- UserA abc.prn
# gzip abc.prn
-rw-rw-rw- UserB abc.prn.gz
-rw-rw-rw- UserB abc.prn
How to preserve the owner of the file abc.prn to original owner ( UserA) ? Thx.
Most likely this isn't possible, cause if a regular user had the power to create a file that another person owns, what would prevent that person to gain access to anything the other owner has that maybe he doesn't want anyone to have access to.
Your best option is to either su to the other user to gzip the file or just change the ownership, etc afterwards.
|All times are GMT -5. The time now is 11:37 AM.|