linux 数据备份到百度云盘

1:php 5.2以上
./configure --prefix=/usr/local/php;make;make install

2:安装wdcp
wget http://down.wdlinux.cn/in/lanmp_wdcp_ins.sh
sh lanmp_wdcp_ins.sh

3:下载bpcs_uploader上传脚本
https://github.com/oott123/bpcs_uploader/tarball/master
tar -zxf master
mv dst_dir baiduyun
cd baiduyun
chmod +x bpcs_uploader.php 
***注意查看上面的文件php的路径是否与之前的一致,如果不是的话修改成一致

4:初始化
./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, your old settings will be overwritten.
Continue? [y/N] y
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   263  100   263    0     0    762      0 --:--:-- --:--:-- --:--:--     0
Launch your favorite web browser and visit https://openapi.baidu.com/device
Input jmmhh6fi as the user code if asked.
After granting access to the application, come back here and press Enter to continue.

####根据上述提示,在浏览器输入https://openapi.baidu.com/device
然后输入 jmmhh6fi 这个授权码就行
后续就是用个人注册的百度云账号进行授权
授权成功之后,在进入ssh界面点击enter键

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   397  100   397    0     0   1193      0 --:--:-- --:--:-- --:--:--     0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    76    0    76    0     0    156      0 --:--:-- --:--:-- --:--:--     0
Access Granted. Your Storage Status: 314.70G/2056.00G (15.31%)
Enjoy!

###显示成功,说明已OK

5:文件上传测试
[root@zzb baidu]# ./bpcs_uploader.php  upload 1.txt svn_back
===========================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
100   397  100   397    0     0   1147      0 --:--:-- --:--:-- --:--:--     0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   374    0   184  100   190    102    105  0:00:01  0:00:01 --:--:--   299
File /apps/bpcs_uploader/svn_back uploaded.
Size:0.007K MD5 Sum:49dae793ec0fc9826138576f28e26d68

####上传的默认路径是:/apps/bpcs_uploader ,可以根据自己的需要在默认路径下创建目录,然后上传的时候加上创建的目录就行
如:./bpcs_uploader.php  upload 1.txt svn_back/3.txt

云盘显示如下:


 

转载于:https://my.oschina.net/u/2343310/blog/865637

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值