1

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.

mrt
  • 13
  • 3
  • 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 03 '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. – Amok Sep 28 '09 at 22:33

4 Answers4

1

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.

Cian
  • 5,838
  • 1
  • 28
  • 40
0

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.

slovon
  • 957
  • 5
  • 12
  • Slovon, Just wanted to give some acknowledgement here as I used your instructions for downloading rsync. Thank you. – mrt Sep 08 '09 at 08:28
0

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

Randall
  • 626
  • 4
  • 4
0

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

Randall
  • 626
  • 4
  • 4