Did you know rsync is available under Mac OS X 10.2? Cool, now you can remotely mirror directories rather than using rcp or scp. rsync can be tunneled over ssh, making it as secure as scp. I'll not go into that for this hint; you'll need to get the general idea first.
Scenario
As a Solaris admin, I have a hardware failover server, and I need to mirror the web_site directory from the primary to secondary server. I use rsync running as a daemon on the "server" to mirror (synchronize) the secondary client. I do this via a cron job at midnight, so I'm never more than 24 hours behind.
This will allow you to synchronize directories and mirror from another machine as a client. Better than remote copy for me. Here's how to do it.
# default: off
# description: The rsync server is a good
# addition to an ftp server, as it
# allows crc check summing etc.
service rsync
{
disable = no
log_on_failure += USERID
socket_type = stream
user = root
server = /usr/bin/rsync
server_args = --daemon
wait = no
only_from = 10.0.0.0
}
# This "only_from = 10.0.0.0" Covers this network.
# Enter the IP or range of which machine can access this sever.
rsync 873/tcp # rsyncI would place it numerically in the 800 range. (duh) ;-)
rsync 873/udp # rsync
[websites]Other options are available:
path = /web_sites
comment = Web Site Directory for OS X
auth users = tridge, susanThe /etc/rsyncd.secrets file would look something like this:
secrets file = /etc/rsyncd.secrets
tridge:mypassI don't use it. If you do, chmod the file to rw acces for root only. Make as many path mappings as you wish.
susan:herpass
% rsync localhost::This should return:
web_sites Web Site DirectoryFor the one we set up.
% rsync -og --compress --recursive --times[The rsync command should be one line, not three as shown here].
--perms --links --delete --verbose
admin@10.0.0.150::web_sites /web_sites/
Mac OS X Hints
http://hints.macworld.com/article.php?story=20021023063424701