LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Transfer large number of files host to host (https://www.linuxquestions.org/questions/linux-newbie-8/transfer-large-number-of-files-host-to-host-839399/)

blainemiller 10-20-2010 05:47 PM

Transfer large number of files host to host
 
Hello....

I have two servers, one has an empty / and the other has a subdirectory with a large number (4 gig) with many, many files. I need a way to transfer the files en masse from the server with the large number of files to the one that is essentially blank.

I don't have space on the used host to simply gzip all the files. I've googled this and see that there may be some combination of tar and/or gzip that will let me do this with some sort of redirection.

I really need and example line of how this can be accomplished. If my explanation seems rather sparse, I can supply more details.

Thanks!

Blaine

sag47 10-20-2010 06:03 PM

Boot to a live CD on the empty host. Set up an NFS server on the populated host sharing it's whole drive. Then mount the empty host drive on the live CD. Then mount the NFS drive on the live CD. Then you can dd the NFS drive to the unpopulated hosts drive. You might want to zero the free space on the populated host drive with dd.

The catch is the empty drive must be equal or larger in size to the populated host. You can expand the partition later but just in case of data corruption do not delete the old host drive which is populated until you're sure you've got all your data. That solution is essentially OS independent because dd will just grab and write blobs of data from disks.

evo2 10-20-2010 06:05 PM

Assuming you have sshd running on at least one of the machines you can use scp or rsync (over ssh)

Eg using rsync.
Code:

user@sourcehost% rsync -auv -e ssh /path/to/dir/ desthost:/path/to/some/dir/
The above will work if you have sshd running on the destination machine. If you only have sshd running on the source machine you would just do something like the following

Code:

user@desthost% rsync -auv -e ssh sourcehost:/path/to/dir/ /path/to/some/dir/
You can read the rsync man page for details.

Cheers,

Evo2.

Tinkster 10-20-2010 09:01 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

http://www.linuxquestions.org/questi...o-host-839359/


All times are GMT -5. The time now is 07:10 AM.