利用bpcs_uploader你可以自动将VPS主机上的文件上传到百度网盘中,同时也可以从百度网盘中下载文件到VPS主机上,让你的文件安全地“住”在百度云中。[font=Tahoma, 'Microsoft Yahei', Simsun]百度云空间容量大,且有了百度这个靠山,日后也不必担心网盘关门走人,随着众多国内网盘开始投放大量的广告到网盘下载页面(典型的有华为网盘、下载赚钱网盘),百度网盘清爽的风格就显得难能可贵了。将文件上传到百度云中就可以方便其它用户下载

1.安装wdcp

wget http://down.wdlinux.cn/in/lanmp_wdcp_ins.sh

sh lanmp_wdcp_ins.sh

2.下载bpcs_uploader上传脚本

https://github.com/oott123/bpcs_uploader/tarball/master

给chmod +x bpcs_uploader.php执行权限

3.查看php路径

/www/wdlinux/nginx_php-5.2.17/bin/php –v

将bpcs_uploader.php第一行修改成

#!/www/wdlinux/nginx_php-5.2.17/bin/php -ddisable_functions -d safe_mode=Off

复制代码

  1. [root@VM_166_159_centos oott123-bpcs_uploader-3a75324]# ./bpcs_uploader.php quickinit
  2. ===========================Baidu PCS Uploader===========================
  3. Usage: ./bpcs_uploader.php init|quickinit|quota
  4. Usage: ./bpcs_uploader.php upload|download path_local path_remote
  5. Usage: ./bpcs_uploader.php delete path_remote
  6. Usage: ./bpcs_uploader.php uploadbig path_local path_remote [slice_size(default:1073741824)]                                                                                                                                                  [temp_dir(def:/tmp/)]
  7. Usage: ./bpcs_uploader.php fetch path_remote path_to_fetch
  8. ========================================================================
  9. Uploader initialization will be begin. If you have already configured the uploader before, y                                                                                                                                                 our old settings will be overwritten.
  10. Continue? [y/N] y
  11.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  12.                                  Dload  Upload   Total   Spent    Left  Speed
  13. 171   263    0   263    0    80    671    204 --:--:-- --:--:-- --:--:--  3210
  14. Launch your favorite web browser and visit https://openapi.baidu.com/device
  15. Input 2a24n8dv as the user code if asked.
  16. After granting access to the application, come back here and press Enter to continue.
  17.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  18.                                  Dload  Upload   Total   Spent    Left  Speed
  19. 244   101    0   101    0   143    531    753 --:--:-- --:--:-- --:--:--     0
  20. OAuth error authorization_pending : User has not yet completed the authorization
  21. Authentication failed. Please check the error message and try again.
  22. Launch your favorite web browser and visit https://openapi.baidu.com/device
  23. Input 2a24n8dv as the user code if asked.
  24. After granting access to the application, come back here and press Enter to continue.
  25. Continue? [y/N] y
  26.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  27.                                  Dload  Upload   Total   Spent    Left  Speed
  28. 244   101    0   101    0   143    546    773 --:--:-- --:--:-- --:--:--     0
  29. OAuth error authorization_pending : User has not yet completed the authorization
  30. Authentication failed. Please check the error message and try again.
  31. Launch your favorite web browser and visit https://openapi.baidu.com/device
  32. Input 2a24n8dv as the user code if asked.
  33. After granting access to the application, come back here and press Enter to continue.
  34. Continue? [y/N] y
  35.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  36.                                  Dload  Upload   Total   Spent    Left  Speed
  37. 180   397    0   397    0   143   2162    778 --:--:-- --:--:-- --:--:--  5772
  38.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  39.                                  Dload  Upload   Total   Spent    Left  Speed
  40.   0    66    0    66    0     0    220      0 --:--:-- --:--:-- --:--:--   366
  41. Access Granted. Your Storage Status: 105.95G/2063.00G (5.14%)
  42. Enjoy!

以上为快速初始化代码,输入授权码网址:https://openapi.baidu.com/device

1.

  1. 然后打开浏览器访问 https://openapi.baidu.com/device ,在“请输入设备上显示的用户授权码:”文本框中输入上面显示的授权码,并点击继续。 看到网页上显示“请返回设备继续操作!”后,返回ssh上按下回车后,即完成了初始化配置。
  2. 重新分配
  3. [root@VM_166_159_centos oott123-bpcs_uploader-3a75324]# ./bpcs_uploader.php init
  4. ===========================Baidu PCS Uploader===========================
  5. Usage: ./bpcs_uploader.php init|quickinit|quota
  6. Usage: ./bpcs_uploader.php upload|download path_local path_remote
  7. Usage: ./bpcs_uploader.php delete path_remote
  8. Usage: ./bpcs_uploader.php uploadbig path_local path_remote [slice_size(default:1073741824)] [temp_dir(def:/tmp/)]
  9. Usage: ./bpcs_uploader.php fetch path_remote path_to_fetch
  10. ========================================================================
  11. Uploader initialization will be begin. If you have already configured the uploader before, your old settings will b                                                                                                                          e overwritten.
  12. Continue? [y/N] y
  13. Please enter your PSC App API Key. You can get this key by visiting http://developer.baidu.com/dev#/create
  14. If you have already created an app, you can visit http://developer.baidu.com/console#/app and get it in your app's                                                                                                                           info.
  15. If you don't want to bother creating an app, you can press Enter to use the demo API Key.
  16. Doing so (without your own API Key/Secret) will cause the access-token to expire every 30 days, and you'll have to
  17. re-initialize when it expires.
  18. App API KEY [uFBSHEwWE6DD94SQx9z77vgG] :uFBSHEwWE6DD94SQx9z77vgG
  19. App API Key has been set to uFBSHEwWE6DD94SQx9z77vgG .
  20. Demo key detected. Using default API Secret.
  21. Demo key detected. Using default app name.
  22.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  23.                                  Dload  Upload   Total   Spent    Left  Speed
  24. 171   263    0   263    0    80   1355    412 --:--:-- --:--:-- --:--:--  3452
  25. Launch your favorite web browser and visit https://openapi.baidu.com/device
  26. Input axmhkper as the user code if asked.
  27. After granting access to the application, come back here and press Enter to continue.
  28.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  29.                                  Dload  Upload   Total   Spent    Left  Speed
  30. 179   395    0   395    0   143   2010    727 --:--:-- --:--:-- --:--:--  5250
  31.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  32.                                  Dload  Upload   Total   Spent    Left  Speed
  33.   0    67    0    67    0     0    294      0 --:--:-- --:--:-- --:--:--   690
  34. Access Granted. Your Storage Status: 105.95G/2063.00G (5.14%)

4.我们测试上传文件

复制代码

  1. ./bpcs_uploader.php upload /www/jiaoguan.txt /www/jiaoguan.                                                                                                                          txt
  2. ===========================Baidu PCS Uploader===========================
  3. Usage: ./bpcs_uploader.php init|quickinit|quota
  4. Usage: ./bpcs_uploader.php upload|download path_local path_remote
  5. Usage: ./bpcs_uploader.php delete path_remote
  6. Usage: ./bpcs_uploader.php uploadbig path_local path_remote [slice_size(default:1073741824)] [temp_dir(def:/tmp/)]
  7. Usage: ./bpcs_uploader.php fetch path_remote path_to_fetch
  8. ========================================================================
  9.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  10.                                  Dload  Upload   Total   Spent    Left  Speed
  11. 197   397    0   397    0   195   1791    880 --:--:-- --:--:-- --:--:--  2767
  12.   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  13.                                  Dload  Upload   Total   Spent    Left  Speed
  14. 131   394  185   185  104   209    242    274 --:--:-- --:--:-- --:--:--   337
  15. File /apps/bpcs_uploader//www/jiaoguan.txt uploaded.
  16. Size:0.019K MD5 Sum:a19e55943b85fe27417653593b6c80e4

测试完工!WDCP自动化运维脚本将于明天发布!

如有问题请加本人QQ:6870608 纯原创 转载注明版权 本文首发腾讯云

Linux命令行上传文件到百度网盘的更多相关文章

  1. [E2E_L9]Linux命令行上传文件到百度网盘

    百度有2TB 存储空间,在有第三方服务器的情况下,很多东西不需要下载到本地,可以直接使用服务转存,这非常好. 系统环境: Linux 系统 + Python 2.7 安装软件工具:[可能会要重复装] ...

  2. [转]Linux命令行上传文件到 百度网盘 bypy

    安装软件工具: apt-get install python-pip pip install requests pip install bypy 授权登陆: 执行 bypy info,显示下边信息,根 ...

  3. linux下通过命令行上传文件到百度网盘

    一.环境: centos release 6.9 python 2.7.13 二.安装工具bypy sudo pip install bypy 三.使用bypy 3.1 授权 [root@ineedl ...

  4. Linux系统通过AWS命令行上传文件至S3

    打开你的AWS控制台: 在IAM中创建一个新用户(比如test),创建时它会自动创建一个用户安全凭证,是由“访问密钥ID”和“私有访问密钥”组成的,请记住它并下载该凭证,后面会用到它: 选择你刚创建的 ...

  5. mac 命令行上传文件,mac tar.gz命令压缩

    在mac上可以直接打开命令行给服务器上传文件,注意是本地的命令行,不是服务器的命令行,我就走了绕路 命令可以看这里https://www.cnblogs.com/hitwtx/archive/2011 ...

  6. Mac安装aws-cli全过程,通过命令行上传文件到aws s3协议服务器

    第一次使用aws,首先查询了各种资料,我第一步需要做的是安装aws-cli,而安装aws-cli之前需要安装python3,当然你安装python3之前你还需要安装homebrew,当然我正在安装的过 ...

  7. Linux命令行上传本地文件到服务器 、 下载服务器文件到本地

    sh使用命令: scp 将本地文件上传至服务器 第一个是本地文件的路径/文件名, 例如 ./index.tar.gz  . index.html . bg.png 等 第二个是要上传到的服务器的位置  ...

  8. Linux: 通过命令行上传文件到ftp服务器

    url -T fie-name ftp://server-address --user user:password

  9. Linux (rz、sz命令行)与本地电脑 命令行上传、下载文件

    Linux 与本地电脑直接交互, 命令行上传.下载文件. 一.lrzsz命令行安装: 1.rpm安装:(链接: http://pan.baidu.com/s/1cBuTm2 密码: vijf) rpm ...

随机推荐

  1. 【Asphyre引擎】冒险岛换装Demo升级到最新版PXL

    demo代码  (不包含Sprite代码,要Sprite代码请下载之前那个doudou的demo)

  2. IO碰到的问题

    1.流关了,并不代表流对象为空 可是java并没提供查看流是否关闭的方法 不过如果流已经关闭了以后,再对流进行操作的话,会抛出IOException:Stream closed异常 可以根据这个异常来 ...

  3. 国外经典设计:12个漂亮的移动APP网站案例

    优秀的移动应用程序网站是设计灵感的重要来源.从美丽的图像,合理的使用空白到排版和颜色的使用,似乎设计师都加倍努力以创造一些美好和独特的设计来推广自己的应用程序. 因此,在这篇文章中,我们已经聚集了13 ...

  4. [deviceone开发]-do_Socket组件示例

    一.简介 do_Socket只实现了socket的客户端的功能,这个示例完整了展示了组件的基本用法,需要和sockettest3工具配合使用,sockettest3做为一个socket server来 ...

  5. bootstrapcss3触屏滑块轮播图

    插件描述:bootslider响应bootstrapcss3触屏滑块轮播图 小海已经好久没分享技术性文章了,这个基于bootstrap的触屏版轮播图绝对满足大家的胃口,并且支持移动端触摸滑动.功能上, ...

  6. ArcPy之Python介绍

    1.Python简介 Python是一种面向对象.解释型计算机程序设计语言;Python是一种简单易学,功能强大的编程语言.它有高效率的高层数据结构,简单而有效地实现面向对象编程.Python简洁的语 ...

  7. [android]亲自破解Flappy Bird(去广告+永生)

    以下内容为原创,欢迎转载,转载请注明 来自天天博客:http://www.cnblogs.com/tiantianbyconan/p/3544785.html  听说最近Flappy Bird很火,但 ...

  8. Python学习01 Hello World

    Python学习之Hello World 准备工作 去官网http://www.python.org/ 下载python的安装包: http://www.python.org/download/ 当前 ...

  9. Laravel 5 性能优化技巧

    说明 性能一直是 Laravel 框架为人诟病的一个点,所以调优 Laravel 程序算是一个必学的技能. 接下来分享一些开发的最佳实践,还有调优技巧,大家有别的建议也欢迎留言讨论. 这里是简单的列表 ...

  10. Android studio 如何查看模拟器里面的文件

    1.查看SD卡里面的内容 2.看数据库