Need help understanding tar xvf and permissions
We have a QA and production server being set up for a new site. There are a group of files in several different directories I'd like to be able to copy from QA to production once they've been tested in QA.
In QA we have super-user root authority. In production we do not. So if we create new files in QA, they typically have owner and group of 'root.' So I created an .sh file in QA that creates a .tar file of all the affected files (about 20-25). I create the .tar file in QA then move the .tar to PROD. The problem is when I extract the .tar file in production via 'tar xvf file' I typically get several permission errors such as: Cannot open: File exists Cannot utime: Operation not permitted Cannot change mode to rwxr-xr-x: Operation not permitted My questions are: 1) When I create the .tar file from QA, is it also storing the owner and group names for each file? 2) If any of the files in the .tar are new to production and were created in QA via the superuser root, does that cause problems copying to production because in prod we don't have superuser authority? In QA should we be using the same group name we use in prod? 3) In the case of "Cannot open: File exists" errors, I was able to fix some by changing the prod group name, but in other cases, even when giving 777 file authority, I continued to get this error message. Man, I'm confused. Any guidance appreciated. Let me know if I can provide more detail. |
Does both QA and production servers use any name service? that means, can they identify same user account?
Well, it depends. It do store ownership, but owner's account (i.e. same username) should be present on both servers. If both servers are using a name service and both can identify same user, then you'll not have any problem in copying/extracting tar files. |
Quote:
So in prod, many files have "ProdOwner" for the owner, and "NiceGroup" for the group. Is the simplest thing to do, for both QA and prod, to have the owner and group both be "NiceGroup"? |
It means, you can login into production from QA using ssh or telnet etc. Then tar file will carry it's ownership/group after copy into QA.
Once try following from QAServer: QAserver# scp -r ProdOwner@prodserver:/path/to/source/example.tar /path/to/target/ And check what ownership it has, using: Code:
ls -l example.tar Code:
chown qauser:qagroup /path/to/target/example.tar |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 09:55 AM. |