Operating System - HP-UX
1827673 Members
3473 Online
109967 Solutions
New Discussion

Re: Need to move some files from machine to machine

 
SOLVED
Go to solution
Kent Ostby
Honored Contributor

Need to move some files from machine to machine

My home directory needs to be moved from machine a to machine b.

I'm looking for a good set of cpio / tar options to get all my subdirectories build into one archive on machine a and then another command to unpack them on the other machine.

Thanks guys,

Kent
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
6 REPLIES 6
Martin Johnson
Honored Contributor

Re: Need to move some files from machine to machine

You could NFS mount the directory and fbackup|frecover the files.

HTH
Marty
Sundar_7
Honored Contributor
Solution

Re: Need to move some files from machine to machine

Try this Kent.

tar -cvf - /home/user1 | remsh node2 "tar -xvf -"

Learn What to do ,How to do and more importantly When to do ?
Tim D Fulford
Honored Contributor

Re: Need to move some files from machine to machine

how about these

Absolute copy src:/home/dir is copied to tgt:/home/dir
on the target machine.
# remsh "tar cf - /home/dir | gzip -" | gunzip - | tar xf -"

or for "realtive" copy to different dir path
src:/home/data to say /home2/stuff/data

on target machine
# cd /home2/stuff/
# remsh "cd /home; tar cf data | gzip -" | gunzip - | tar xf -

I've used both.

Tim
-
Joe Short
Super Advisor

Re: Need to move some files from machine to machine

Try rcp. first cd to one directory below your home dirictory ant the rcp the entire directory structure over.

cd /home
rcp -r -p mydir hostname2:/home

That should do it!
Pete Randall
Outstanding Contributor

Re: Need to move some files from machine to machine

Kent,

Assuming NFS is available, you can use cpio like this:

cd /net/machineA/home/Kent
find . -print |cpio -pdumxl /home/Kent

This will transfer everything under machineA's /home/Kent to machineB's /home/Kent.


Pete

Pete
Kent Ostby
Honored Contributor

Re: Need to move some files from machine to machine

Thanks guys.

I did the "tar" listed by Sundar .
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"