How to realize the function of resuming File at breakpoint by Linux
What is a breakpoint continuation?
In the case of poor network conditions, for file transfer, we hope to be able to support the transfer of some data at a time. In fact, the breakpoint continuation is literally meant to continue the transmission at the disconnect point of the download, without having to start from scratch. So after understanding the core of the breakpoint continuation, I found that it is actually very simple, and the key lies in the grasp of the transmission breakpoint. I drew a simple diagram of my own understanding:
Linux breakpoint continuation file
When uploading and downloading files in the Linux system, it is easy to disconnect or transfer large files. How to continue the transfer after disconnection does not have to start over. Here we can use Linux's rsync.
instructions
File breakpoint download
Rsync-P-rsh=ssh root@192.168.0.11:/root/large.tar.gz / dounine/targe.tar.gz
File breakpoint upload
Rsync-P-rsh=ssh / dounine/targe.tar.gz root@192.168.0.11:/root/large.tar.gz
File directory breakpoint download
Rsync-P-rsh=ssh-r root@192.168.0.11:/root/storage / dounine
File directory breakpoint upload
Rsync-P-rsh=ssh-r / dounine root@192.168.0.11:/root/storage
Run in the background and put the above script in the shell file
Cat bg.sh
Rsync-P-rsh=ssh-r root@192.168.0.11:/root/storage / dounine &
Background operation
Chmod + x bg.shnohup. / bg.sh
Upload and download by ordinary way
Upload files
Scp / dounine/targe.tar.gz root@192.168.0.11:/root/large.tar.gz
Download a file
Scp root@192.168.0.11:/root/large.tar.gz / dounine/targe.tar.gz
Upload directory
Scp-r / dounine root@192.168.0.11:/root
Download directory
Scp-r root@192.168.0.11:/root/storage / dounine
Summary
The above is the whole content of this article, I hope that the content of this article has a certain reference and learning value for your study or work, if you have any questions, you can leave a message and exchange, thank you for your support.