SCP without changing permissionss


 
Thread Tools Search this Thread
Operating Systems Solaris SCP without changing permissionss
# 1  
Old 07-12-2010
SCP without changing permissionss

Hi all,

I need to copy files from server-1 to server-2.

But i need to preserve the permissions.

What i exactly need to preserve is only the owner of the file. I have a diff group name in the Server -2 ...
is there any way to specify whom to be owner of the file and which group should me owner for files by using SCP....


Server -1 : -rw-r--r-- 1 user1 groupA 5115374 Apr 15 15:30 no.txt

to copied to server -2 which should look like

Server -2: -rw-r--r-- 1 user1 groupB 5115374 jul 12 15:30 no.txt

Please help
thanks,
# 2  
Old 07-12-2010
scp -p will allow you to preserve modes, atime, mtime but not UID/GID.

If you want to preserve all the file's attributes, use rsync

Quote:
rsync -ave ssh /path/to/file user@host:/path/to/file
Actually, rsync will allow you to preserve just the 'uid' or 'gid', but won't let you rewrite these details. Might be best to change those values after the transfer.
# 3  
Old 07-16-2010
server1# scp -rp no.txt user1@server2:/path/.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to use scp?

How to copy multiple directories using single command on solaris 10 from server A to server B. I tried scp but its working only one directory at atime How to acheive this with simple and short solution????? (6 Replies)
Discussion started by: buzzme
6 Replies

2. UNIX and Linux Applications

Need help with scp

Hi, I am trying to do scp from server A to server B. But while doing the scp i am getting the following message. +-----------------------------------------------------------------+ | This system is for the use of authorized users only. | | Individuals using this computer system... (6 Replies)
Discussion started by: sidh_arth85
6 Replies

3. AIX

scp

1. how to move files in a directory using scp ? 2. how to move the entire directory ? 3. Will the file and the directory permissions affect scp usage? (1 Reply)
Discussion started by: samsungsamsung
1 Replies

4. Red Hat

scp with su

Hi Friends, I am trying to copy some files over the network in between my linux servers. I am using scp command for this. by default direct ssh root login is disabled on all of my linux servers. Normaly we used to login as a normal user and the su to th root user. unfortunately root user is... (1 Reply)
Discussion started by: arumon
1 Replies

5. UNIX for Advanced & Expert Users

help with scp

hi all in my script i was using the "scp" command to copy 2 files from a certain directory on server A to the same directory on another server B, but for some reason its only copying the first file in the directory. This is the frst time that i used the scp command,any ideas appreciated. thnks (5 Replies)
Discussion started by: bkan77
5 Replies

6. Shell Programming and Scripting

Changing userID and Changing group and GID

Hello, I want to write a ksh script about changing UID and changing group with GID. There are multiple servers i want to perform that job. linux1 linux2 linux3 linux4 linux5 ...... . . . . . 1.) How can i enter "password" in script rather asking me? I was trying this... ssh... (2 Replies)
Discussion started by: deal732
2 Replies

7. Shell Programming and Scripting

What is scp-ed over?

Hi all, i have a directory in server A. the directory path is /home/kevin. I need to scp the directory to another server B. i would like to ask, when i do a scp of the /home/kevin , i can expect all the files from A to go B. However, how about the hidden files? for example the ssh keys in the... (4 Replies)
Discussion started by: new2ss
4 Replies

8. UNIX for Advanced & Expert Users

Scp

I am trying to transfer a 10g files using scp, but I am getting timeout errors is there anywhere that I can modify a config file or something to increase the time. (4 Replies)
Discussion started by: rbizzell
4 Replies

9. UNIX for Dummies Questions & Answers

scp

How do i use scp to copy a file from my home directory on a server I am logged into, to the computer I am using? I thought it would be something like: scp filename mycomp.company.org Thanks. (2 Replies)
Discussion started by: ignus7
2 Replies
Login or Register to Ask a Question