Large file splitting and transmission in Linux

Source: Internet
Author: User

If the network is unstable during the remote transmission of large files through large file splitting in Linux, you may consider splitting large files into multiple small files in the specified size to facilitate retransmission. You can compare the MD5 code before and after file transmission to determine whether the file is damaged or tampered. The following is a complete example of transferring a 17G large file (win2008.img): 1. Calculate the MD5 code of a large file: Java code md5sum win2008.img 2. Split the file by a fixed size of MB: java code split-B 500 m win2008.img win2008 where win2008.img is the name of the file to be split, win2008 is the prefix of the generated file name for the split, the generated file is win2008aa, win2008ab ....... win2008az, win2008ba .... according to the actual size of the split file, the last small file may be less than 500 mb. 3. Calculate the MD5 code of each small file: Java code for var in $ (ll | grep win2008 | awk '{print $9}'); do md5sum $ var; done pasted an output column of MD5 code into excel for comparison. 4. scp remotely transfers all small files. 5. After the transfer, calculate the MD5 code of all small files on the target machine. If the MD5 code of a small file is different from that of the corresponding small file before transmission, the file is incorrect and re-transmitted. 6. Merge small files into large files. The Java code cat win2008 *> win2008.img is separated alphabetically. cat is also processed alphabetically. 7. Calculate the MD5 code of the merged large file: Java code md5sum win2008.img 8. Consistent with the MD5 code of the large file before transmission, this indicates that the large file is successfully transmitted.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.