大小限制的wget可以下载 [英] Limit size wget can download

查看:270
本文介绍了大小限制的wget可以下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能限制或从网站上限数据的wget 下载量?或者通过服务器设置或的wget 设置?

Is it possible to limit or cap the amount of data wget downloads from a site? Either via server setting or wget setting?

例如,一个页面是1GB大小,我想wget来停在100MB下载。

For example, one page is 1GB size, I want wget to stop downloading at 100MB.

推荐答案

利用该系统来限制处理通过的ulimit 命令资源的消耗应该只是工作的能力。假设你使用bash:

Leveraging the ability for the system to limit processes resource consumption through the ulimit command should just work. Assuming you use bash:

(ulimit -f 102400; wget $url)

下面的尺寸是在1024字节的块。请注意,如果您使用不同的仍然符合标准的外壳,或使用庆典在POSIX模式下,块大小是512字节,因此该命令应该是:

Here the size is in 1024 bytes blocks. Note that if you use a different still standard compliant shell, or use bash in POSIX mode, the block size is 512 bytes so the command should be:

(ulimit -f 204800; wget $url)

这篇关于大小限制的wget可以下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆