Need to transfer files between 2 UNIX servers, with same folder permission


 
Thread Tools Search this Thread
Operating Systems Solaris Need to transfer files between 2 UNIX servers, with same folder permission
# 1  
Old 11-06-2012
Need to transfer files between 2 UNIX servers, with same folder permission

I need to transfer directories/files between 2 Unix servers, with same folder permission.
I tried scp, but it retains the the permissions, but changes the owner of the directory/file to the user used to copy them to the destination. I don't want that to happen.
If possible without any other additional installation of tools.

Thanks,
Pandee
# 2  
Old 11-06-2012
If your requirement is to change the owner of directory & files within it, then try below command after transferring:-
Code:
ssh $user@$host "chown -R user <absolute path of dir>"

where user is user to which ownership needs to be given. I hope your have setup ssh-keys between these servers.
This User Gave Thanks to Yoda For This Post:
# 3  
Old 11-06-2012
Hi Bipin,

Thanks for your quick reply.

Actually I want to move a directory as a whole from one server to another server, provided each of the files/sub-directories under that has the same permission and owner as that of the source.
# 4  
Old 11-06-2012
Quote:
Originally Posted by Pandee
Hi Bipin,

Thanks for your quick reply.

Actually I want to move a directory as a whole from one server to another server, provided each of the files/sub-directories under that has the same permission and owner as that of the source.
Use rsync like below :

Code:
rsync -avz /folders/  user@targethost:/destination/

or with ssh :

Code:
rsync -avz -e ssh  /folders/  user@targethost:/destination/

Make sure you hav the same set of users owning the files in the source folders present in the destinations else the owner:group would be changed to uid and gid of the source.
# 5  
Old 11-06-2012
Hi Ningy,

for using rsync, should I need to install the tool?
I'm working on SunOS 5.10 Generic_144488-10 sun4v sparc SUNW,Sun-Fire-T200
Could you please let me know the procedure to install or configure it, if needed?

Thanks,
# 6  
Old 11-06-2012
is it not installed already ?

Code:
pkginfo |grep rsync

IF not check for it on the installation pack CD/DVD or download it from sunfreeware .
# 7  
Old 11-06-2012
Also using tar and ssh to retain permissions.
Code:
tar cvf - dir/ | ssh server2 "cd /dest/dir && tar xvf -"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Reset Permission Of Files and Folder

Hi, Call me stupid but i accidentally executed following command : find $INSTALLDIR/ -type f -exec chmod 644 {} \; now after which I am not able to run any command in system even ls command is giving me error for "permission denied" :( (5 Replies)
Discussion started by: itajooba
5 Replies

2. UNIX for Dummies Questions & Answers

UUCP Transfer Files to Old UNIX Computer

I recently installed AT&T UNIX SysV, on an old Pentium computer. I now find that I am unable to transfer files to and from the computer. I previously posted about problems mounting a floppy drive, but that is just bringing up more problems about the filesystem format. JGT brought to my attention... (27 Replies)
Discussion started by: BrentBANKS
27 Replies

3. Windows & DOS: Issues & Discussions

Transfer of zipped folder from windows desktop to UNIX server

Hi all, I'm a newbie to unix. My requirement is to create an automation script which will transfer a zipped folder from my/remote desktop to an unix server. Tools lik WinSCP shouldnt be used. No manual moving. I use putty to connect to server. I couldnt find any help on this topic. Should i use... (3 Replies)
Discussion started by: sherin22
3 Replies

4. Shell Programming and Scripting

Comparing file ownership/permission and content of files located on two different servers

Hi All, can some one suggest me a tool to compare file ownership/permission and contents of files located at two different unix servers? Thanks, Pranav (1 Reply)
Discussion started by: Pranav Bhasker
1 Replies

5. Shell Programming and Scripting

Permission Denied to transfer files

Hi, I got a problem about new user that will be used by another system to transfer files. It threw back with error as below. ftp> put pom.txt 200 PORT command successful. 553 pom.txt: Permission denied. I'm not sure that's because the destination directory was created by another user.... (2 Replies)
Discussion started by: Kapom
2 Replies

6. UNIX for Advanced & Expert Users

permission for all the files in a folder

Hi Guys, Is there a command or some way whenever any file is created in a folder is having a default permission. Cheers!!! (2 Replies)
Discussion started by: mac4rfree
2 Replies

7. Shell Programming and Scripting

Need script using cp to transfer files to another folder

Hi guys , how are you doing? I am tryng to make a script using cp that i would like to do this: echo "Enter the name files to tranfer" then user has to enter via keyboard this kind of output file1 file 2 file 3 file x (i mean the number of the files could vary and their name too)... (1 Reply)
Discussion started by: REX:)
1 Replies

8. UNIX for Advanced & Expert Users

How to transfer files from Unix to Windows.

Hi There is a requirement for me to transfer files from Unix to windows in an automation process of unix. Please let me know is it posibble to shell scripting this? Could you help me in scripting it? Regards Venugopal (2 Replies)
Discussion started by: venu_eie
2 Replies

9. UNIX for Dummies Questions & Answers

How to transfer files from UNIX to my own Hard drive storage?

I will leave the University I am working, but I need to backup and transfer my research data from UNIX system in our department to my own 750G Hard Drive Storage. But I am not familiar with UNIX. How to do this? Thank you. (5 Replies)
Discussion started by: fishwater00
5 Replies

10. Shell Programming and Scripting

transfer of files via ftp from windows to unix

I am currently looking to write a script to transfer files from a windows NT server to a unix server any ideas of how to go about this? (1 Reply)
Discussion started by: chambala5
1 Replies
Login or Register to Ask a Question