发表于 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
一串码拷贝进来
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
如果还不行,重启服务器
上传完毕在 百度网盘 > 我的应用数据 > bypy 目录下
后记:和朋友讨论服务器
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/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢