Linux命令行上传文件到百度网盘
利用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
- [root@VM_166_159_centos oott123-bpcs_uploader-3a75324]# ./bpcs_uploader.php quickinit
- ===========================Baidu PCS Uploader===========================
- Usage: ./bpcs_uploader.php init|quickinit|quota
- Usage: ./bpcs_uploader.php upload|download path_local path_remote
- Usage: ./bpcs_uploader.php delete path_remote
- Usage: ./bpcs_uploader.php uploadbig path_local path_remote [slice_size(default:1073741824)] [temp_dir(def:/tmp/)]
- Usage: ./bpcs_uploader.php fetch path_remote path_to_fetch
- ========================================================================
- Uploader initialization will be begin. If you have already configured the uploader before, y our old settings will be overwritten.
- Continue? [y/N] y
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 171 263 0 263 0 80 671 204 --:--:-- --:--:-- --:--:-- 3210
- Launch your favorite web browser and visit https://openapi.baidu.com/device
- Input 2a24n8dv as the user code if asked.
- After granting access to the application, come back here and press Enter to continue.
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 244 101 0 101 0 143 531 753 --:--:-- --:--:-- --:--:-- 0
- OAuth error authorization_pending : User has not yet completed the authorization
- Authentication failed. Please check the error message and try again.
- Launch your favorite web browser and visit https://openapi.baidu.com/device
- Input 2a24n8dv as the user code if asked.
- After granting access to the application, come back here and press Enter to continue.
- Continue? [y/N] y
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 244 101 0 101 0 143 546 773 --:--:-- --:--:-- --:--:-- 0
- OAuth error authorization_pending : User has not yet completed the authorization
- Authentication failed. Please check the error message and try again.
- Launch your favorite web browser and visit https://openapi.baidu.com/device
- Input 2a24n8dv as the user code if asked.
- After granting access to the application, come back here and press Enter to continue.
- Continue? [y/N] y
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 180 397 0 397 0 143 2162 778 --:--:-- --:--:-- --:--:-- 5772
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 0 66 0 66 0 0 220 0 --:--:-- --:--:-- --:--:-- 366
- Access Granted. Your Storage Status: 105.95G/2063.00G (5.14%)
- Enjoy!
以上为快速初始化代码,输入授权码网址:https://openapi.baidu.com/device
1.
- 然后打开浏览器访问 https://openapi.baidu.com/device ,在“请输入设备上显示的用户授权码:”文本框中输入上面显示的授权码,并点击继续。 看到网页上显示“请返回设备继续操作!”后,返回ssh上按下回车后,即完成了初始化配置。
- 重新分配
- [root@VM_166_159_centos oott123-bpcs_uploader-3a75324]# ./bpcs_uploader.php init
- ===========================Baidu PCS Uploader===========================
- Usage: ./bpcs_uploader.php init|quickinit|quota
- Usage: ./bpcs_uploader.php upload|download path_local path_remote
- Usage: ./bpcs_uploader.php delete path_remote
- Usage: ./bpcs_uploader.php uploadbig path_local path_remote [slice_size(default:1073741824)] [temp_dir(def:/tmp/)]
- Usage: ./bpcs_uploader.php fetch path_remote path_to_fetch
- ========================================================================
- Uploader initialization will be begin. If you have already configured the uploader before, your old settings will b e overwritten.
- Continue? [y/N] y
- Please enter your PSC App API Key. You can get this key by visiting http://developer.baidu.com/dev#/create
- If you have already created an app, you can visit http://developer.baidu.com/console#/app and get it in your app's info.
- If you don't want to bother creating an app, you can press Enter to use the demo API Key.
- Doing so (without your own API Key/Secret) will cause the access-token to expire every 30 days, and you'll have to
- re-initialize when it expires.
- App API KEY [uFBSHEwWE6DD94SQx9z77vgG] :uFBSHEwWE6DD94SQx9z77vgG
- App API Key has been set to uFBSHEwWE6DD94SQx9z77vgG .
- Demo key detected. Using default API Secret.
- Demo key detected. Using default app name.
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 171 263 0 263 0 80 1355 412 --:--:-- --:--:-- --:--:-- 3452
- Launch your favorite web browser and visit https://openapi.baidu.com/device
- Input axmhkper as the user code if asked.
- After granting access to the application, come back here and press Enter to continue.
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 179 395 0 395 0 143 2010 727 --:--:-- --:--:-- --:--:-- 5250
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 0 67 0 67 0 0 294 0 --:--:-- --:--:-- --:--:-- 690
- Access Granted. Your Storage Status: 105.95G/2063.00G (5.14%)
4.我们测试上传文件
- ./bpcs_uploader.php upload /www/jiaoguan.txt /www/jiaoguan. txt
- ===========================Baidu PCS Uploader===========================
- Usage: ./bpcs_uploader.php init|quickinit|quota
- Usage: ./bpcs_uploader.php upload|download path_local path_remote
- Usage: ./bpcs_uploader.php delete path_remote
- Usage: ./bpcs_uploader.php uploadbig path_local path_remote [slice_size(default:1073741824)] [temp_dir(def:/tmp/)]
- Usage: ./bpcs_uploader.php fetch path_remote path_to_fetch
- ========================================================================
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 197 397 0 397 0 195 1791 880 --:--:-- --:--:-- --:--:-- 2767
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 131 394 185 185 104 209 242 274 --:--:-- --:--:-- --:--:-- 337
- File /apps/bpcs_uploader//www/jiaoguan.txt uploaded.
- Size:0.019K MD5 Sum:a19e55943b85fe27417653593b6c80e4
测试完工!WDCP自动化运维脚本将于明天发布!
如有问题请加本人QQ:6870608 纯原创 转载注明版权 本文首发腾讯云
Linux命令行上传文件到百度网盘的更多相关文章
- [E2E_L9]Linux命令行上传文件到百度网盘
百度有2TB 存储空间,在有第三方服务器的情况下,很多东西不需要下载到本地,可以直接使用服务转存,这非常好. 系统环境: Linux 系统 + Python 2.7 安装软件工具:[可能会要重复装] ...
- [转]Linux命令行上传文件到 百度网盘 bypy
安装软件工具: apt-get install python-pip pip install requests pip install bypy 授权登陆: 执行 bypy info,显示下边信息,根 ...
- linux下通过命令行上传文件到百度网盘
一.环境: centos release 6.9 python 2.7.13 二.安装工具bypy sudo pip install bypy 三.使用bypy 3.1 授权 [root@ineedl ...
- Linux系统通过AWS命令行上传文件至S3
打开你的AWS控制台: 在IAM中创建一个新用户(比如test),创建时它会自动创建一个用户安全凭证,是由“访问密钥ID”和“私有访问密钥”组成的,请记住它并下载该凭证,后面会用到它: 选择你刚创建的 ...
- mac 命令行上传文件,mac tar.gz命令压缩
在mac上可以直接打开命令行给服务器上传文件,注意是本地的命令行,不是服务器的命令行,我就走了绕路 命令可以看这里https://www.cnblogs.com/hitwtx/archive/2011 ...
- Mac安装aws-cli全过程,通过命令行上传文件到aws s3协议服务器
第一次使用aws,首先查询了各种资料,我第一步需要做的是安装aws-cli,而安装aws-cli之前需要安装python3,当然你安装python3之前你还需要安装homebrew,当然我正在安装的过 ...
- Linux命令行上传本地文件到服务器 、 下载服务器文件到本地
sh使用命令: scp 将本地文件上传至服务器 第一个是本地文件的路径/文件名, 例如 ./index.tar.gz . index.html . bg.png 等 第二个是要上传到的服务器的位置 ...
- Linux: 通过命令行上传文件到ftp服务器
url -T fie-name ftp://server-address --user user:password
- Linux (rz、sz命令行)与本地电脑 命令行上传、下载文件
Linux 与本地电脑直接交互, 命令行上传.下载文件. 一.lrzsz命令行安装: 1.rpm安装:(链接: http://pan.baidu.com/s/1cBuTm2 密码: vijf) rpm ...
随机推荐
- JVM内存格局总结
最近一次面试,面试官让我讲讲JVM的内存这一块的理解.我回答的不满意,今天做一个总结. 做一个产品,最终要做到高并发.高可靠.归根结底,是对CPU.内存等资源受限所作出的解决方案.就内存而言,我们写的 ...
- Elasticsearch1.7到2.3升级实践总结
概括 简述 升级分为Elasticsearch server升级和Elasticsearch client api升级 为什么要迁移 当前团队内多个业务方公用一套ES集群,容易被影响,重要业务应该独自 ...
- Verilog学习笔记认识提升篇(一)...............时序的基本概念(待补充)
建立和保持时间: 建立时间(Tsu)是指在时钟上升沿到来之前数据必须保持稳定的时间,保持时间(Th)是指在时钟上升沿到来以后数据必须保持稳定的时间.一个数据需要在时钟的上升沿被锁存,那么这个数据就必须 ...
- Guava学习笔记:Immutable(不可变)集合
不可变集合,顾名思义就是说集合是不可被修改的.集合的数据项是在创建的时候提供,并且在整个生命周期中都不可改变. 为什么要用immutable对象?immutable对象有以下的优点: 1.对不可靠的客 ...
- SSH中的jar包讲解(1)
我们在搭建SSH框架的时候,需要引入各自的一些jar包,相信很多初学者跟我一样,搜个资料,照搬过来(当然版本还得对应),至于为什么要引入这些个jar包,引入它们的作用是啥子,一头雾水,今天我就来跟这些 ...
- ASP.NET MVC下使用文件上传
这里我通过使用uploadify组件来实现异步无刷新多文件上传功能. 1.首先下载组件包uploadify,我这里使用的版本是3.1 2.下载后解压,将组件包拷贝到MVC项目中 3. 根目录下添加新 ...
- 杭电acm2029-Palindromes _easy version
Problem Description “回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串.请写一个程序判断读入的字符串是否是“回文”. Input 输入包 ...
- HTML5夜空烟花绽放动画效果
模板描述:HTML5夜空烟花绽放动画效果基于HTML5 canvas制作,模拟夜空烟花绽放动画效果,烟花会在夜空打出贺词,有新年快乐.合家幸福.万事如意.心想事成.财源广进等,文字可以自定义,做成各种 ...
- SharePoint 2013 Content Deployment 报错 These columns don't currently have unique values
错误描述: These columns don't currently have unique values. Content deployment job 'job name' failed.The ...
- iOS 单例模式 浅叙
单例模式作用 可以保证在程序运行过程中,一个类只有一个实例,而且该实例易于供外界使用 从而方便地控制了实例个数,并节约系统资源 单例模式使用场合 在整个引用程序中,共享一份资源(这份资源只需要创建初始 ...