项目作者: forecho

项目描述 :
备份数据库和文件夹到阿里云的 OSS
高级语言: Shell
项目地址: git://github.com/forecho/backupToOSS.git
创建时间: 2017-07-31T08:22:13Z
项目社区:https://github.com/forecho/backupToOSS

开源协议:BSD 3-Clause "New" or "Revised" License

下载


DigitalOcean Referral Badge

Backup to Cloud Storage

Backup your database and files to Cloud Storage.

What can it do?

  • Backup MySQL database
  • Backup directory (multiple)

How to use

Install dependencies

  1. sudo apt-get install zip -y

Install python3

  1. sudo apt-get install python3 python3-pip -y
  2. pip3 install pyyaml
  3. pip3 install oss2 # aliyun oss (optional)
  4. pip3 install cos-python-sdk-v5 # tencent cos (optional)
  5. pip3 install b2sdk # backblaze b2 (optional)

Clone the project

  1. git clone https://github.com/forecho/backup-to-cloud-storage.git

Config

  1. cd backup-to-cloud-storage && cp config.example.yml config.yml

Run

  1. python3 backup.py

Cron

  1. $ crontab -e

add this line

  1. 0 2 * * * /usr/bin/python3 /root/backup-to-cloud-storage/backup.py

Thanks