Linux Remote copy (speed limit and resumable upload)

Source: Internet
Author: User
Tags ssh port man rsync

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:

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.