On Thu, 2002-11-07 at 19:13, Sebastian McDonagh wrote:
> Time to change over the mail server and am copying down /home to the new
> server.  I am currently trying to do this via scp, now i dont claim to
> be any expert but from reading the man pages on scp i should be able to
> use the -rp switches to 1. Copy recursively and 2. maintain file
> permissions of those directories and subdir.
> 
> Anyway my problem is twofold and i would really appreciate any
> assistance you guys could give.
> 
> The first thing is copying the directories over,
> The command i am using is,
> 
> scp -rp X.X.X.X /home/* /home/
> 
> Now this sure gets the directory down but then they are all owned by
> root and are in the root group.  Now this is obviously going to be a
> problem.

Use rsync instead:

        rsync -aHe ssh  /home/   X.X.X.X:/home

The 'a' option means archive mode and does a recursive copy that
preserves times, permissions and (if root) owner/group info.  The 'H'
option preserves hard-links and the 'e ssh' tells it to transfer over
ssh.  The trailing slash on the '/home/' means to copy the contents of
the local /home directory.  'X.X.X.X:/home' is the destination of /home
on host X.X.X.X.

You can add the 'v' (verbose) option to watch the names scroll by and
the 'P' to see transfer progress of each file if you're using a slow
link.  The 'c' option will run 'MD4' checksums at each end to increase
the robustness of the copy.

If you add additional options, make sure that the 'e' option is last:

        rsync -avcPHe ssh   /home/   X.X.X.X:/home

You can interrupt the transfer and rerun it using the same command.  It
will resume at the correct point and continue.

Seth



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to