linux 百度云 备份软件下载,Linux 安装百度云,自动备份服务器资料

发表于 2018-08-11 02:06:23 by 月小升

起因:

我的服务器只有一台,尽管只放了自己的java-er.com的资料,但是我还是想一些

系统:

CentOS 系统

安装pip

首先安装epel扩展源:

yum -y install epel-release

更新完成之后,就可安装pip:

yum -y install python-pip

安装完成之后清除cache:

yum clean all

sudo pip install requests

yum依赖python 2.6 修改yum文件头

vi /usr/bin/yum

改文件第一句

#!/usr/bin/python2.6

升级pip

wget https://bootstrap.pypa.io/get-pip.py

python get-pip.py

/usr/local/bin/pip2.7 -V

pip 18.0 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)

pip -V

pip 7.1.0 from /usr/lib/python2.6/site-packages (python 2.6)

改下

ln -s /usr/local/bin/pip2.7 /usr/bin/pip

pip -V

pip 18.0 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)

ls /usr/bin/ | grep pip

pip升级完毕

同步百度云

###################################

pip install bypy

顺利了

bypy info

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Encoding for StdOut: ANSI_X3.4-1968

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Please visit:

https://openapi.baidu.com/oauth/2.0/authorize?scope=basic+netdisk&redirect_uri=oob&response_type=code&client_id=q8WE4EpCsau1oS0MplgMKNBn

And authorize this app

Paste the Authorization Code here within 10 minutes.

Press [Enter] when you are done

一串码拷贝进来

3b488ef64c32ec8a633d64848ef46a8b.png

dc1005fe954059042d1e5bf31dd8eabd.png

Authorizing, please be patient, it may take upto 300 seconds…

Authorizing/refreshing with the OpenShift server …

OpenShift server failed, authorizing/refreshing with the Heroku server …

Successfully authorized

Quota: 2.010TB

Used: 210.787GB

这样就成功了。

更详细的了解某一个命令:

#bypy help 显示在云盘(程序的)根目录下文件列表:

#bypy list

把当前目录同步到云盘:

#bypy syncup

或者

#bypy upload

把云盘内容同步到本地来:

#bypy syncdown

或者

#bypy downdir /

比较本地当前目录和云盘(程序的)根目录(个人认为非常有用):

#bypy compare

Add in -v parameter, it will print more details about the progress.

Add in -d parameter, it will print some debug messages.

Add in -ddd, it will display HTTP messages as well (Warning: A lot)

中文那些事

bypy syncup报出错误

Encoding for StdOut: ANSI_X3.4-1968

yum groupinstall chinese-support

vim /etc/sysconfig/i18n

#LANG="en_US.UTF-8"LANG="zh_CN.UTF-8"

SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"

SYSFONT="latarcyrheb-sun16"

vi ~/.bashrc

加入

export LC_ALL=en_US.UTF-8

export LANG=en_US.UTF-8

export LANGUAGE=en_US.UTF-8

$ source ~/.bashrc

locale

LANG=zh_CN.UTF-8

LC_CTYPE=”zh_CN.UTF-8″

LC_NUMERIC=”zh_CN.UTF-8″

LC_TIME=”zh_CN.UTF-8″

LC_COLLATE=”zh_CN.UTF-8″

LC_MONETARY=”zh_CN.UTF-8″

LC_MESSAGES=”zh_CN.UTF-8″

LC_PAPER=”zh_CN.UTF-8″

LC_NAME=”zh_CN.UTF-8″

LC_ADDRESS=”zh_CN.UTF-8″

LC_TELEPHONE=”zh_CN.UTF-8″

LC_MEASUREMENT=”zh_CN.UTF-8″

LC_IDENTIFICATION=”zh_CN.UTF-8″

LC_ALL=zh_CN.UTF-8

如果还不行,重启服务器

a84b4c39af33b9428a60f6ea2c6b8795.png

上传完毕在 百度网盘 > 我的应用数据 > bypy 目录下c02194d60dba43d29a5085065a849e30.png

后记:和朋友讨论服务器

2007年得时候搞搜索引擎,那时候hadoop还很年轻,我也很年轻,有60台服务器一起玩,是怎么也想不到还需要手工备份的。

备份的历史

1.手工下载到本地,按时间命名

2.手工下载到本地,然后传到百度云

3.使用

有个朋友问,一周一次,万一我忘记了呢,告诉你个秘密,数据库要一天一个备份,然后,然后做成全自动得定时备份,定时发到自己邮箱。你的博客数据库太大,我不保证这点子好用。 一般情况网站的代码不用天天备份,天天需要备份的是数据库

2018-8-11 下午睡醒一觉,忘记说了,bypy 只需要授权一次,意味着可以做成定时命令自动备份,哥喜欢全自动。喜欢

bypy官方

https://github.com/houtianze/bypy

This entry was posted in Linux and tagged 备份, 百度云. Bookmark the permalink.

月小升QQ 2651044202, 技术交流QQ群 178491360

首发地址:月小升博客 – https://java-er.com/blog/linux-bai-du-yun-server/

无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值