Linux:wget后台下载/查看后台任务进度

今天在自己的服务器上使用wget下载一个大文件时,不小心把ssh断开连接了,重新登上去后想查看这个文件的下载进度,现记录一些wget的知识点。

1:后台下载

使用wget -b + url

[root@8f9fbda9bb48 ~]# wget -b http://cn.wordpress.org/wordpress-3.1-zh_CN.zip 
Continuing in background, pid 835.
Output will be written to 'wget-log'.

后台任务启动后,会返回两段话,第一段返回一个pid,代表这个后台任务的进程,并且我们可以kill掉这个id来终止此次下载,第二段返回了一句话,意思是会将输出(持续)写入到wget-log这个文件。

2:查看wget后台进度

有几种方法可以查看:

-1:使用(断点续传)wget -c +正在执行的下载地址

root@8f9fbda9bb48 hadoop]# wget -c  http://archive.apache.org/dist/hadoop/common/hadoop-2.8.0/hadoop-2.8.0.tar.gz        
--2018-12-20 11:14:10--  http://archive.apache.org/dist/hadoop/common/hadoop-2.8.0/hadoop-2.8.0.tar.gz
Resolving archive.apache.org (archive.apache.org)... 163.172.17.199
Connecting to archive.apache.org (archive.apache.org)|163.172.17.199|:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 429928937 (410M), 353392307 (337M) remaining [application/x-gzip]
Saving to: 'hadoop-2.8.0.tar.gz'

18% [++++++++++++++++++++++++++>                       ] 80,019,652  9.68KB/s  eta 7h 51m 

-2:找到下载文件的文件夹,其中那个正在写入的输出文件,使用

       tail -f wget-log

[root@8f9fbda9bb48 hadoop]# tail -f wget-log
--2018-12-20 09:31:08--  http://archive.apache.org/dist/hadoop/common/hadoop-2.8.0/hadoop-2.8.0.tar.gz
Resolving archive.apache.org (archive.apache.org)... 163.172.17.199
Connecting to archive.apache.org (archive.apache.org)|163.172.17.199|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 429928937 (410M) [application/x-gzip]
Saving to: 'hadoop-2.8.0.tar.gz'

24% [===================================>             ] 104,682,854 11.0KB/s  eta 7h 24m 

可以实时查看下载进度,ctrl + c 可退出。

也可使用

cat wget-log

root@8f9fbda9bb48 hadoop]# cat wget-log
--2018-12-20 09:31:08--  http://archive.apache.org/dist/hadoop/common/hadoop-2.8.0/hadoop-2.8.0.tar.gz
Resolving archive.apache.org (archive.apache.org)... 163.172.17.199
Connecting to archive.apache.org (archive.apache.org)|163.172.17.199|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 429928937 (410M) [application/x-gzip]
Saving to: 'hadoop-2.8.0.tar.gz'

20% [=============================>                    ] 87,723,878  8.44KB/s  eta 7h 43m

来查看当前进度。

  • 43
    点赞
  • 63
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值