SUMMARY: transferring files between machines

From: Rebecca Littleton (
Date: Wed Feb 21 1996 - 08:43:06 CST

        Thanks to everyone who responded so promptly to my
question about how to transfer files between machines
running Solaris 2.5. The suggestions tell me how to avoid
the prompt at the end of ufsrestore, how to use tar to do
the transfer, and offer alternative utilities. Thanks
so much.
Rebecca Littleton
West Virginia University
Fairmont WV

         I have some information in a directory on hostA. I want
 to keep a duplicate of this directory on hostB by copying from
 hostA to hostB daily. Both machines run Solaris 2.5.
         I would like to use ufsdump/ufsrestore or tar run from a cron
 job to perform this transfer. I saw a recent post
 about transfering files between Solaris and SunOS machines using
 the following command:
   rsh hostA ufsdump 0f - /home/proj | (cd /newhome && ufsrestore xf -)
 When run from the command line, this command successfully copies
 the files from hostA to hostB but a response is required by ufsrestore
 when finished:
                 Do you want to set mode on . (yn)
 Is there a way to get around this query since I want to run the
 command from cron, or should I use tar instead?
 If tar is the way I should go, please let me know how to use it.
         Your help is appreciated. Thanks.

RESPONDERS: -- Thanks!
From: charest@CANR.Hydro.Qc.CA (Claude Charest)
From: "John A. Murphy" <>
From: "Michael Bennett"
From: (Martin Achilli)
From: (Maes_Eric)
From: (Glenn Satchell - Uniq Professional Services)
From: stern@sunrise.East.Sun.COM (Hal Stern - Distinguished Systems Engineer)
From: terry gorby <>

On the ufsrestore command change "xf" for "rf" and it will work. After that,
rm the "restoresymtable" file on the "/newhome".
With the "ufsdump" command you copy all the files everyday. You could just
copy the new or modified files. That will recude the traffic...
first day before the cycle:
        - touch /home/proj/datestamp_file
other days on:
        - find . -newer /home/proj/datestamp_file ...
        - touch /home/proj/datestamp_file
Look at the "cp -p", "tar" or "install" man pages...
Just a quickie
I think you may be better off using rdist.
As long as all the absolute paths are the same, you should have no
problem, and it's safe and easy to set up.
Do you want to set mode....
is only asked when you use restore interactively, if you use the "r" flag to restore (i.e. restore everything) the question is not asked.
  ... ufsrestore -rf -
The -r option does not ask for a user response. Alternatively look at
using rdist, eg:
  hosta% rdist -c /home/proj hostB:/newhome
rdist is also nice because it preserves ownership, permissions and
modification dates. It also only copies over the files that have
changed, making a big saving if only some of your files change each
Use expect.
why not just use tar, unless you want to copy special files
*or* not change the access times on the files. if you don't
mind having the access times changed, then use:
        tar cf - . | rsh otherhost "( cd /remotedir; tar xvf - )"
  cd parent_dir # parent directory of directory to copy.
   tar -cvpBf - relative_directory_name | rsh remote_system " cd parent_dir; tar -xvBf -"

to copy /usr/mydir to the system called server
   cd /usr
   tar -cvpBf - mydir | rsh server " cd /usr; tar -xvpBf -"

don't know about the ufsdump/restore pipe.

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:54 CDT