Linux Remote copy (speed limit and resumable upload)
# Scp copy 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 'P', because-P is already reserved
For preserving the times and modes of the file in rcp (1 ).
#-P specifies the port of the remote server ssh service, for example, ssh port 61204
-L limit
Limits the used bandwidth, specified in Kbit/s.
-L the speed limit for the specified copy is ct/s. For example,-l 40000 indicates 40000 Kbit/s = 40000/8 KB = 5 MB.
Note: scp does not support resumable data transfer.
Rsync + ssh resumable upload
# 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 100' -- bwlimit = 61204 filename username@10.20.90.101:/data/tmp/> scp_to_101.log
-A: operations in archive mode. Copying directories and symbolic connections is equivalent to-rlptgoD.
-V: Detailed prompt
-Z: Compression
-P: integrates two parameters: -- partial -- progress.
-- Partial
If the transmission is interrupted during the file copy process, rsync deletes some copied files from the target machine by default.
If you do not need to re-copy all files during the next copy, you can use the-partial option to prevent rsync from deleting the copied part during transmission interruption.
-- Progress bar
-E: the function of the parameter is to allow the user to freely select the shell program to connect to the remote server.
Ssh-p 61204 specifies the ssh port (non-default 22) 61204
-- Bwlimit: -- bwlimit = 5000 bandwidth limit: 5000 k Bytes/s = 5 MB
Example above: Use rsync to transfer the local file filename to the/data/tmp directory of 192.168.188.188 and use compressed archiving for transmission at a speed limit of 5 MB. Support for resumable data Transfer Using ssh protocol
For more information, see man scp and man rsync.
This article permanently updates the link address: