Technical article 125883

How can I copy files from one server to another?

OpenServer 5.0.7UnixWare 7.0.0UnixWare 7.0.1UnixWare 7.1.0UnixWare 7.1.1UnixWare 7.1.3UnixWare 7.1.4Open UNIX 8

Written · Last revised

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.com
If 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.so

i.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:
/.rhosts
on "serverb" in the form:
servera.fqdn.com

and 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 /.rhosts

Run a test from one server to the other, in this case from servera:

# rsh serverb -l root lc

should 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 /data
4.  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:/data
or:
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 distfile

This 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@mydomain
or:

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.cpio
For UnixWare7:
-------------
This is available from http://samba.org/ftp/rsync/src/ and can be
downloaded and compiled using:
TA 127036

It 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 127036

It 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

From the Xinuos technical article database, record 125883. Reproduced with permission. The original is at www.sco.com/ta/125883, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.