Giter VIP home page Giter VIP logo

baidu_pcs_cli's Introduction

#说明 命令行工具基于libcurl+ 百度PCS的rest API ,适用于linux,Mac OS #依赖 libcurl >= 7.18, centos/redhat 5自带curl版本较低,编译前请升级

ubuntu:sudo apt-get install libcurl4-gnutls-dev

#安装

首先

make
make install

然后

请在 ~/.baidu_pcs.ini 中设置api_key及api_secret

默认配置文件搜寻路径为:

    ~/.baidu_pcs.ini
    ./etc/baidu_pcs.ini

#使用方法

使用方法: baidu_pcs 命令 [选项]

命令列表:

info      查看云盘信息

ls        列出远程文件或目录
          选项:
            -l 显示详细信息
            -r 递归子目录

upload   [选项] [本地路径] [远程路径] 上传文件或目录
          选项:
            覆盖策略
            默认:略过已存在同名远程文件
            -o 覆盖远程同名文件
            -n 如果存在同名文件,创建以日期结尾的新文件

            -p 指定上传分片大小,例如 -p100M
            -l 跟随软链

download [选项] [远程路径] [本地路径] 下载文件或目录
          选项:
            -o 覆盖本地同名文件
            -n 如果存在同名文件,创建以日期结尾的新文件
cp       [远程路径] [目的远程路径] 复制远程文件或目录
mv       [远程路径] [目的远程路径] 移动远程文件或目录
rm       [远程路径] 删除远程文件或目录

#你可能需要知道

  1. pcs api只能操作/apps/xxx下的文件
  2. 默认文件分片尺寸为50M
  3. 下载可以输出到标准输出baidu_pcs down /apps/xxx/test.mp4 - | mplayer -cache 8192 -
  4. API使用https协议,curl初始化时设置了速度较快的rc4加密方式
  5. 所有请求失败会重试5次
  6. 非上传请求,5秒连接超时,20秒请求超时
  7. 上传请求,5秒连接超时,文件尺寸/(10K/s)的上传超时
  8. 上面你都可以自己改了重新编译。。。

baidu_pcs_cli's People

Contributors

emptyhua avatar brain-zhang avatar wmh avatar

Watchers

Michael.Ma avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.