Problem
I need to copy my /data (for example) directory from one
SCO Unix server to another. I don't have the disk space
capacity to cpio all the files into one cpio file then ftp
that file to the other server then un-cpio at the other
end. Solution
Create a trust between the two servers using the following method:
1. First ensure the two servers can ping each other using
their shortnames or Fully Qualified Domain Names.# ping serverb# ping serverb.fqdn.comIf this doesn't work then either one of the servers is not
on the network or there is a name resolution issue. If
the server is using DNS to resolve its names then you can
enter the name directly into the /etc/hosts file, using
your favorite editor and ensure that the name resolution is
set for /etc/hosts over DNS by running:# scoadmin client -> Services -> Name Resolution Order and then
highlighting /etc/hosts and Promote it above DNS.This is a front end to the file:
/etc/netconfig and it's first line should then read:
tcp tpi_cots_ord v inet tcp /dev/tcp
/usr/lib/tcpip.so,/usr/lib/resolv.soi.e. ensuring that the name resolution refers to the /etc/hosts file first then DNS.
2. Add a trusted equivalence for each server in the file:/.rhostson "serverb" in the form:servera.fqdn.comand perform the same on servera for a two way equivalence.
Note that when you open an editor to create /.rhosts, it will probably have 644 permissions, and that will require you to run:
# chmod 600 /.rhostsRun a test from one server to the other, in this case from servera:
# rsh serverb -l root lcshould give you a list of the directory contents of root.
For OpenServer5/6, use "rcmd" in place of "rsh" here and below.
3. On serverb make sure there is a directory into which
you wish to copy the data, for example:# cd /
# mkdir /data4. On servera run the following command to copy the data:# cd /data# find . -print | cpio -ovcB | rsh serverb 'cd /data ;
cpio -ivdumcB'or:# rcp -rp . serverb:/dataor:Create a "distfile" in the form:HOSTS = ( root@serverb )FILES = ( /data )${FILES} -> ${HOSTS}
install -R ;Here, we are going to sync the files in /data from this server to "serverb" and run the command "rdist" in the form:
# rdist -iR -f distfileThis will add new files, update any changed files and remove any files that are on "serverb" but not your server.
A slightly more complex "rdist" file would like:
HOSTS = ( root@serverb )FILES = ( /data /u/app/bin /u/app/scripts /u/app2/bin /u/app2/scripts )
${FILES} -> ${HOSTS}
install -R ;
except /u/app/bin/*.idx ;
except /u/app/bin/file.db* ;
except /u/app2/bin/*.idx ;
except /u/app2/bin/file.db* ;Need to change the destination address, eg: /data on one server to /data/backup on another then:
FILES = ( /data ) ... install -R /data/backup ;
Here's an example script to run this with:
#!/bin/sh
#
# ident "@(#) data.sync"
# comment "@(#) Backup Data Folders to DR Server"
#
# Usage: $0
#
# Typical "root" Cron entry to run the simple.backup
# 59 6 * * 1-5 /local/sysadm/data.sync > /local/sysadm/data.sync.log 2>&1
#
# This script should be modified to suit your own environment prior to running.
#PATH=/bin:/usr/bin:/etc:/local/bin
export PATH#
# Sync up with the DR Server
echo "\nRunning RDIST to sync up /data ... "
rdist -iR -f /local/sysadm/distfile
head -100 /local/sysadm/data.sync.log > /tmp/data.sync.log
tail -100 /local/sysadm/data.sync.log >> /tmp/data.sync.log
cat /tmp/data.sync.log | mail -s "`uname -n`: data sync report" me@mydomainor:The industry standard for file sycning is 'rsync' and while this is not provided by the operating system as standard, it is available from our open source, Skunkware, site at:
For OpenServer6:
---------------
ftp://ftp2.sco.com/pub/skunkware/osr6/vols/rsync-3.0.2Sa-VOLS.cpioFor UnixWare7:
-------------
This is available from http://samba.org/ftp/rsync/src/ and can be
downloaded and compiled using:TA 127036It is also available on request from SCO Support for supported SCO customers or can be compiled using:
For OpenServer5:
---------------
This is available from http://samba.org/ftp/rsync/src/ and can be
downloaded and compiled using:TA 127036It is also available on request from SCO Support for supported SCO customers.
See also
hosts.equiv(4tcp)rcp(1tcp)rdist(1Mtcp)TA111764, "UnixWare 7, How do I migrate user and printer information between UnixWare x and UnixWare 7?"
How do I configure FTP on UnixWare7:
http://uw714doc.xinuos.com/en/NET_tcpip/ftpN.intro.html