Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to have a set of directories on server A copied to server B each night. At present:

I have a share on server A which is mounted on server B

a job run by cron on server B copies each directory and its contents from A to B, preserving permissions.

After the first run, some files fail to copy because of the permissions.

rsync would be good, but it doesn't exist in Solaris 10.

Note: If SSH/SCP is part of the answer, please could you include or link to info on how to configure it (beginner level please!) SSHD is running on both servers, but SCP either reports 'Permission Denied' if I specify batch mode, or else it simply prompts 'Password' and rejects every password I try.

share|improve this question
    
Looking at Cian and slovon's answers, your next question should be "What's the best place for 3rd party Solaris packages?" :) –  Gerald Combs Sep 3 '09 at 15:33
    
I currently use rsync to synchronize files between Mac OS X and Solaris, so it does exist and it's also easy to get. –  Amuck Sep 28 '09 at 22:33

4 Answers 4

up vote 1 down vote accepted

You can do it with scp if you first setup ssh keys (instructions here) so you don't need password authentication. The other thing you could do is install rsync, it's available in both sunfreeware and blastwave, or could be compiled from source for your system. In any case though if you do use rsync, I'd probably advise on using the ssh transport.

None of these will deal with permissions though. If the user the commands are running as don't have permission to read/write to the relevant directory, this will still fail.

share|improve this answer
    
Cian - Many thanks, best ssh instructions I've seen. –  mrt Sep 8 '09 at 8:26

Best would be to use rsync (copy, archive mode) or tar/star through ssh.

As for not having rsync, you can always pull the package from opencsw package system. It is worth reading about it! Install is extremely easy, just run as root the following:

# pkgadd -d http://www.opencsw.org/pkg_get.pkg

Then for adding rsync, you make:

# pkg-get -i rsync

and there you have it. You copy with rsync as follows (this copies all permissions and attributes):

# rsync -av /source/dir /dest/dir

Here is a nice recipe for doing rsync over ssh with description on how to make ssh keys, etc.

share|improve this answer
    
Slovon, Just wanted to give some acknowledgement here as I used your instructions for downloading rsync. Thank you. –  mrt Sep 8 '09 at 8:28

Are you sharing the directories from server A with the root=server-B option? This will allow the root cronjob on server B access to the directories and its contents. As to a source for rsync, you could use the Solaris 10 Companion CD

share|improve this answer

Are you sharing the directories from server A with the root=server-B option? This will allow the root cronjob on server B access to the directories and its contents. As to an alternate source for rsync, you could use the Solaris 10 Companion CD

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.