Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to copy remotely, limit speed and resume transmission at breakpoint under Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to copy remotely, speed limit and breakpoint continuation under Linux. I hope you will get something after reading this article. Let's discuss it together.

Scp command-copy files remotely

Scp copies the local file filename to the / data/tmp directory of the remote machine 192.168.188.188 server

Scp-P 61204-l 40000 filename username@192.168.188.188:/data/tmp/

-P port Specifies the port to connect to on the remote host. Note that this option is written with a capital'Pants, because-p is already reserved for preserving the times and modes of the file in rcp (1).

#-P specify the port of the remote server ssh service, such as ssh port 61204

-l limit Limits the used bandwidth, specified in Kbit/s.

-l specifies that the speed limit of the copy is in ct/s. For example,-l 40000 indicates the speed of 40000Kbit/s=40000/8KB=5MB.

Note: scp does not support resuming from breakpoints.

Rsync + ssh breakpoint continuation

# rsync synchronizes the local file filename to the / data/tmp directory of the remote machine 192.168.188.188 server

Rsync-avzP-e'ssh-p 61204'-bwlimit=5000 filename username@10.20.90.101:/data/tmp/ > > scp_to_101.log

-a: operates in archive mode, copying directories and symbolic links, equivalent to-rlptgoD.

-v: detailed prompt

-z: compression

-P: yes, two parameters of-partial-progress are integrated.

-partial if the transfer is interrupted while copying files, the default action of rsync is to undo the pre-operation, that is, to delete some of the copied files from the target machine. If you want to continue the file on the next copy and do not need to re-copy all the files, you can use the-partial option to prevent rsync from deleting the copied parts if the transfer is interrupted.

-progress displays the progress bar

-e: the parameter allows users to freely choose the shell program they want to use to connect to the remote server

Ssh-p 61204

Specify the port of the ssh (other than the default 22) 61204

-bwlimit:-bwlimit=5000 limits bandwidth to 5000k Bytes/s = 5MB

Example above: use rsync to transfer local files filename to 192.168.188.188 / data/tmp directory using compressed archive transfer, speed limit 5MB, support breakpoint continuation using ssh protocol details can be found in man scp and man rsync manuals

After reading this article, I believe you have a certain understanding of "how to copy remotely, limit speed and continue transmission at breakpoints under Linux". If you want to know more about it, please follow the industry information channel and thank you for your reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report