python脚本备份linux,linux利用bypy自动备份文件上传百度云

前言

云服务器跑着各种项目,包括这个博客,所以数据文件相当重要,尤其运行那么多年,早期编写shell脚本定时备份到服务器指定地方,现在担心什么时候服务器也挂,于是想到自动备份到百度云盘.

准备

centos服务器,python环境

步骤

安装bypy

pip install bypy

国内网速有点慢,如果失败多重试几次

如提示 You should consider upgrading via the 'pip install --upgrade pip' command.

则更新pip即可

pip install --upgrade pip

执行

bypy info

如果提示

-bash: bypy: command not found,则需要卸载重装

pip uninstall bypy

正常输出

Please visit:

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

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

你可能感兴趣的:(python脚本备份linux)