这是一个好用的局域网文件备份工具,解决日常工作和生活中需要局域网定时文件、数据库备份的需求。
我的博客:www.gaojunxin.cn
- 定时文件备份并上传到服务端(已经实现)
- 定时mysql备份并上传到服务端(已经实现)
- 局域网文件上传和下载(尚未实现)
客户端实现了根据配置文件config.yml来定时备份数据库和文件夹,然后自动上传备份文件到服务端。
- 安装python环境
- 安装pipenv
pip install pipenv- 安装脚本依赖
pipenv install- 修改config.yml中的配置,并将整个agent文件夹放置在需要执行备份任务的计算机上。
- 启动客户端
# 进入agent目录
cd agent
# 安装依赖
pipenv install
# 执行启动程序
pipenv run python agent.py具体配置可以参考agent/config.yml文件中的注释
服务端采用flask实现了一个简单的文件上传,待完善更多功能。
同客户端
- 启动服务端
# 进入agent目录
cd server
# 安装依赖
pipenv install
# 执行启动程序
pipenv run python app.py
#后台执行
pipenv run python -u agent.py >> agent.log &提示如下日志,则启动成功
❯ pipenv run python app.py
* Serving Flask app 'app'
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: 142-650-752
目前只实现了客户端自动上传到服务端,没有界面上的过多操作,等待后续补充操作界面。
