温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

scp和rsyc限速传输

发布时间:2020-08-09 21:35:23 来源:ITPUB博客 阅读:105 作者:不一样的天空w 栏目:建站服务器

http://blog.chinaunix.net/uid-23544240-id-3488256.html

一、scp限速1M

scp -l 1000 文件名  账号@远程机器IP

此时的传输速率就是1M/8=100K左右

二、rsync是(限制为 100k Bytes/s):

rsync -auvzP--bwlimit=100 本地的文件 远程的文件

参数说明:

v:详细提示

a:以archive模式操作,复制目录、符号连接,等价于 -rlptgoD 。

z:压缩

u:只进行更新,防止本地新文件被重写,注意两者机器的时钟的同时

P:是综合了--partial --progress两个参数,

所以此时的rsync支持了断点续传

机房之间传文件一般都担心带宽占用太多,特别是在共用带宽的情况下。常用的两个软件都可以限速:

scp可以加上 -l 参数:

引用

     -l limit

             Limits the used bandwidth, specified in Kbit/s.

             

rsync可以加上 --bwlimit 参数

引用

        -i, --itemize-changes       output a change-summary for all updates

            --log-format=FORMAT     output filenames using the specified format

            --password-file=FILE    read password from FILE

            --list-only             list the files instead of copying them

            --bwlimit=KBPS          limit I/O bandwidth; KBytes per second

            --write-batch=FILE      write a batched update to FILE

            --like --write-batch but w/o updating dest    

            

KBs是KByte/s的缩写,Kbit/s应该是Kbps(缩写为KB/s)。KB/s通常用于传输速度,例如在复制文件时。Kb/s通常用

于宽带速度,如512Kb/s.

宽带通常以每秒千字节为单位安装,但实际下载速度与通常的千字节完全不同。例如:512kbps宽带,下载速度每秒

512 / 8=64KB/s。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI