Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Simple Method For Duplicating Files Remotely
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2869
Location: Omnipresent

PostPosted: Fri Aug 02, 2002 7:59 pm    Post subject: Simple Method For Duplicating Files Remotely Reply with quote

Hi,

I recently installed Gentoo on my laptop, and wanted to migrate my home directory from my old desktop to the laptop. My desktop does not have a CD burner (and I had 4GB of files anyway), but it does have an ssh server.

So, I set up a two machine network through a hub. I then tried to use scp. In the following example, 'myself' is my username on the desktop, and 'desktop' is the desktop machine's hostname (or IP address if you like):

Code:
root% cd /home
root% time scp -prC myself@desktop:/home/myself .
root% chown -R myself.users myself


Unfortunately, it took forever (over four hours) and turned out horribly. scp has a per-file connection overhead, always dereferences symlinks, and chokes when transferring files whose names have illegal characters.

Then, I tried:

Code:
root% cd /home
root% time ssh myself@desktop 'cd /home; tar -cpz myself' | tar -xzvf -
root% chown -R myself.users myself


Through a 10Mbit hub this process took about 2.5 hours, but everything went perfectly. The ssh command asks for a password, but that did not seem to affect the untarring on the local side.

Certainly, for continuing backups or mirroring one should use rdiff-backup or rsync which does things incrementally. The method here is best for installs or creating data clones; the biggest benefits:

    * There is no setup required for the software apart from having ssh and tar on both ends.

    * There is very little overhead.

    * No disk space or time is wasted on the remote side making a massive tar archive of the target directory.

A simple improvement is to use rsh instead of ssh for a small performance boost (discarding encryption/decryption), but I did not have the rsh server on my desktop, and in my case I was bandwidth limited anyway. Also, one can try not using compression ("-z"), esp. if mostly moving precompressed files, like MP3s or AVIs.

Sorry if this is old hat for many of you, but I thought it might be useful for n00bs (like myself) doing fresh installs.


Hypnos
Back to top
View user's profile Send private message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1311
Location: Munich / Germany

PostPosted: Sat Aug 03, 2002 10:24 pm    Post subject: Reply with quote

Hi,

if you're inside a local lan, try netcat (nc). It is even faster than rsh.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum