一个伪linux粉丝的blog

  1. 首页
  2. unix/linux
  3. 正文

download files from qiniu

28 10 月, 2018 1717点热度 0人点赞 0条评论

几个月前其实收到了七牛云的邮件通知,大概是逐步关闭测试域名啥的,也没在意,毕竟我是2014年开始使用七牛云的用户,也付过几百块账单,最近发现几个自定义的2级域名也陆续被关闭了,登陆管理后台发现无法下载,有些文件仅此一份,开始傻眼了,文件还是得想办法弄下来啊。找到一个帖子

https://www.heartnn.com/2018/10/09/batch-download-qiniu-files/

还好有https://github.com/qiniu/qshell 这种神器,支持批量复制到新的空间,然后批量下载到本地。

老规矩,自己做过的操作自己写一遍,免得其他博客某天消失了。

步骤1,先建一个新的bucket,例如download, 思路就是利用这个新的download来过渡,下载原来的其他bucket

步骤2,得到账号信息

1
2
3
qshell account AccessKey SecretKey 
这个信息在账号后台可以找到,我是在win10下执行这个命令的,会在用户目录下生成一个文件
C:\Users\daniel\.qshell\account.json

步骤3, 执行 qshell 先查看自己目前有的 bucket

1
qshell buckets

发现我有 wanjie 这个老的bucket需要下载

步骤4,那么先得到wanjie原有的文件结构列表

1
qshell listbucket wanjie list.txt

注意处理这个list.txt 字符集为utf-8, 仅保留第一列的内容,这就是你所需要的文件目录结构,其余文件信息干掉。

步骤5,然后执行

1
qshell batchcopy wanjie download list.txt

,文件将全部复制到名为download的bucket中。

如果前面list.txt 行数特多,建议分拆,多执行几次,免得出现如下提示:“ 400 Bad Request和error message “key must not contain null byte”。”

步骤6、之后新建一个config.txt,内容大致如下:

1
2
3
4
5
6
7
8
9
10
{
<span style="color: #f92672;">"dest_dir"</span> : <span style="color: #e6db74;">"E:\\qiniu\\wanjie\\download"</span>,
<span style="color: #f92672;">"bucket"</span> : <span style="color: #e6db74;">"download"</span>,
<span style="color: #f92672;">"access_key"</span> : <span style="color: #e6db74;">"xxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxx"</span>,
<span style="color: #f92672;">"secret_key"</span> : <span style="color: #e6db74;">"xxxxxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxxxx"</span>,
<span style="color: #f92672;">"cdn_domain"</span> : <span style="color: #e6db74;">"phb6zvtni.bkt.clouddn.com"</span>,
<span style="color: #f92672;">"is_private"</span> : <span style="color: #66d9ef;">false</span>,
<span style="color: #f92672;">"prefix"</span> : <span style="color: #e6db74;">""</span>,
<span style="color: #f92672;">"suffix"</span> : <span style="color: #e6db74;">""</span>
}

dd

步骤7,qshell qdownload 3 config.txt进行下载,其中3为线程数。

qshell-qdownload

qshell-qdownload

如果有多个bucket需要下载,可以先执行qshell batchdelete download list.txt将download清空,然后再复制新的bucket进去。,,

步骤8,赶紧将得到的文件存到自己的空间把,多备份。

2019.9.12更新,今天发现有个历史文件没下载,然后跑了一遍qshell,当前版本2.4,有些参数有变化了
如第一段

1
qshell account AccessKey SecretKey 

目前执行下来,会有一个报错,command account receives zero or three args, received 2
原来是 AccessKey SecretKey 首字符如果是字母的话,需要添加参数--
即目前为

1
qshell account -- AccessKey SecretKey 

其他,导出,导入,都有参数上的变化,注意看帮助

相关文章:

  1. plowshare -- command-line application to download files for file-sharing websites
  2. SSHTunnel Provides a Secure Internet Connection for Your Android
  3. Titan6800上运行Google Android1.5
  4. Google Music 4.0.1 apk download
标签: qiniu qshell
最后更新:12 9 月, 2019

wanjie

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

This site uses Akismet to reduce spam. Learn how your comment data is processed.

归档
分类
  • network / 332篇
  • Uncategorized / 116篇
  • unix/linux / 121篇
  • 业界资讯 / 38篇
  • 公司杂事 / 11篇
  • 数码影像 / 12篇
  • 美剧 / 3篇
  • 美图共赏 / 21篇
  • 英语学习 / 3篇
标签聚合
天翼live 泰国 浏览器 虚拟主机 k8s wget postgres 邮件归档 debian Google Voice gitlab ldap 网站运营 nexus dreamhost Ubuntu kubectl kernel dreamhost空间 deepseek squid d90 Nginx google-chrome openssl ssh jira VPS docker Google

COPYRIGHT © 2008-2025 wanjie.info. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang