1. Copy file between 3 file systems with limited disk space and behind firewall
1. Copy file between 3 file systems with limited disk space and behind firewall
Let's imagine that we have 3 machines : hostA, hostB, hostC.
Machines hostA and hostB can see each other but hostC is outside firewall and we can only see hostC from hostB not from hostA.
We have to transfer a file called H42880477.iso between hostA and hostC which is 1.7 GB size but hostB has only 200 MB of /temp space.
Algorithm :
-----------
0. Calculate MD5 finger print of H42880477.iso on hostA
1. Divide file into pieces <= 200MB each on hostA 2. Move each file piece between hostA and hostB 3. Move each file piece between hostB and hostC 4. Merge file pieces into single file named H42880477.iso on hostC 5. Calculate MD5 finger print of H42880477.iso on hostC and compare it with step 0.
[hostA]# md5sum H42880477.iso
19fd802912a9b5ce2067786e7ecf80a7 H42880477.iso
[hostA]# split --bytes=200000000 --verbose H42880477.iso
[hostA]# scp /home/jakubn/Downloads/xaa jakubn@hostB:/home/plp90763/patches/
[hostA]# scp /home/jakubn/Downloads/xab jakubn@hostB:/home/plp90763/patches/
[hostA]# scp /home/jakubn/Downloads/xac jakubn@hostB:/home/plp90763/patches/
[hostA]# scp /home/jakubn/Downloads/xad jakubn@hostB:/home/plp90763/patches/
[hostA]# scp /home/jakubn/Downloads/xae jakubn@hostB:/home/plp90763/patches/
[hostA]# scp /home/jakubn/Downloads/xaf jakubn@hostB:/home/plp90763/patches/
[hostA]# scp /home/jakubn/Downloads/xag jakubn@hostB:/home/plp90763/patches/
[hostA]# scp /home/jakubn/Downloads/xah jakubn@hostB:/home/plp90763/patches/
[hostA]# scp /home/jakubn/Downloads/xai jakubn@hostB:/home/plp90763/patches/
[hostA]# ssh jakubn@hostB
[hostB]# scp /home/jakubn/patches/* jakubn@hostC:/home/jakubn/patches2
[hostB]# rm -r ./x*
[hostB]# ssh jakubn@hostC
[hostC]# cat x* >> H42880477.iso
[hostC]# md5sum H42880477.iso
If MD% finger print is equal in step 0 and step 5 then we assume that the file is untouched and it is secure to further use it.
Brak komentarzy:
Prześlij komentarz