3 月 262014
 

再上一个博客说明用api实现linux的传输,后来在研究的过程中,发现有个更利于linux的shell操作,故记录下来

http://developer.baidu.com/wiki/index.php?title=docs/cplat/stor/sdk#Shell-Tool

下载Baidu_BCS_Shell-Tool_V1.2.zip,在linux解压,不过他的配置文件bsconf时乱码的,可以自己重新导入下。

要设置

ak=KKKKKKKKK
sk=KKKKKKKKK

其他的可以不修改,不过我修改了以下参数:

#文件大小超过MULTI_UPLOAD_LEN_LIMIT,则采用并发上传,并发数由put_thread_num设置
MULTI_UPLOAD_LEN_LIMIT=2000m

#put_thread_num表示并发上传数
put_thread_num=10

#put_retry_num表示上传的重试次数
put_retry_num=10

还有它的文档比较老,用的那个参数有问题,可以直接通过 ./bsutil.sh 查看帮助。

./bsutil.sh [-v] cp local_file bs://bucket/object
./bsutil.sh [-v] bcp [-r] local_dir bs://bucket/folder/
由于我要传大文件,直接用上面那个就可以了。

bucket是 云存储建的  object其实就是文件名,不要安装文档上写的http什么的,否则会报错。

这个脚本主要能自动合并,所以传大文件没有问题,即使超过2G的文件。

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny