Copying files to a different server without Permission level change..

Hi,

I was trying to copy/transfer some new and old files from one server to another server. I found the permission of the files are different in both servers. I tried to tar all the files and then send to the other server, and then also the permission level is different after copying the files.

I have checked with UMASK and also try to create a new files in both servers using 'touch' command. But, I found all are same, NO difference.

Is there any command or way to copy the files without changing their permission level ??? e.g. if a file has permission as '444' in one server, after transferring to other server, it's shows permission as '544' or '554' etc.

You can use scp -p when you have ssh set up or tar it before you copy it maybe.

Thanks for the response. I used to tar all the files and sends to the other server. Till then, it's working fine.

But, when I try to un-tar the file and try to putback the files in their
respective directories, I am getting the mismatch in the permission level.

The problem is in the other server, I am trying to copy the files from the tar one and trying to put them in their respective directories. And the problem arises.

How do you copy them? Do you add a -p to your copy command, whichever you use?

tar -czvpf file.tar.gz <directory>

'p' in option can help you