[mdlug] Transfering /home with scp

Wojtak, Greg GregWojtak at quickenloans.com
Mon Mar 3 13:37:44 EST 2008


If I were you, I would do the following on the source machine:

# cd /home
# tar cpf - * | ssh -l root target_host '(cd /home; tar xpf - )'

Scp has some issues with maintaining permissions (or maybe it's
ownerships?).

Greg

-----Original Message-----
From: mdlug-bounces at mdlug.org [mailto:mdlug-bounces at mdlug.org] On Behalf
Of Peter Bart
Sent: Monday, March 03, 2008 1:26 PM
To: MDLUG main discussion list
Subject: [mdlug] Transfering /home with scp

Hi Everyone,
	I'm finally at the point of transferring all my files to my new
notebook. The old one is a T30 Thinkpad running opensuse 10.3 and the
new one is a T61 Thinkpad running opensuse 10.3. Can I simply use scp
to copy the entire /home? Or are there files in /home that would be
specific to the hardware/operating system it's on? 
      If I do, I know I must use the -r flag to copy
directories recursivly, the -p flag to preserve ownership and
permissions. What about directories/files that allready exist and
should be replaced, such as /home/.evolution? I've read that cp and scp
are intentionally similar. The man page for cp lists -f as the flag to
be used to replace an existing file if it can't be written to. I don't
see the -f/force flag on scp's man page.  I'm somewhat at a loss on how
to do that part. Of course I could delete all the files in /home before
copying. But I've added programs on the new machine so that seems a
little much because I don't want to remove files that won't be replaced
and I might need.
    Would tar be a better, quicker option? ie Create the archive
of /home on the old machine,
burn
it to disc, then unpack it on the new machine? I tried to make an
archive of my /home several times but I think I wasn't patient enough
or used the wrong command because it either didn't work or was taking
several hours. On the other hand it appears that when unpacking an
archive it overwrites existing files of the same name in the directory
it's unpacked.
    There is probably another option I don't know about, so please
suggest it!

Best Regards, 

-- 
Peter The Plumber sm on the Road
State Licensed Plumber
State Certified Backflow Device Tester
Factory Trained Boiler Install/Service
<http://petertheplumber.net>
24h Service 313.215.5175

Don't sleep with a drip! Call a licensed and experienced plumber.
_______________________________________________
mdlug mailing list
mdlug at mdlug.org
http://mdlug.org/mailman/listinfo/mdlug



More information about the mdlug mailing list