简单的数据库全量定时备份系统, 目前还处于开发阶段, 建议使用于开发测试环境
安装 mysqldump/pg_dump/mongodump
config.yaml
level: "debug" # 日志等级
store: "/app/data" # 存储
cron: "* * * * *" # 定时
backup:
- type: mysql # 数据库类型 (pg, mysql)
host: 192.168.1.1 # 数据库地址
port: 3306 # 数据库端口
user: root # 数据库用户
password: root # 数据库密码
- type: pg
host: 192.168.1.1
port: 5432
user: root
password: root
- type: mongo
host: 192.168.1.1
port: 27017
user: ""
password: ""
- type: scp
user: root
password: root
host: 192.168.52.147
port: 22
fromPath: /tmp/scp
./gobackup
config.yaml
level: "debug" # 日志等级
store: "C:\\Users\\admin\\Desktop\\goproject\\gobackup\\data" # 存储
cron: "* * * * *" # 定时
backup:
- type: mysql # 数据库类型 (pg, mysql)
host: 192.168.1.1 # 数据库地址
port: 3306 # 数据库端口
user: root # 数据库用户
password: root # 数据库密码
- type: pg
host: 192.168.1.1
port: 5432
user: root
password: root
- type: mongo
host: 192.168.1.1
port: 27017
user: ""
password: ""
- type: scp
user: root
password: root
host: 192.168.52.147
port: 22
fromPath: /tmp/scp
./gobackup.exe # 执行定时任务
./gobackup.exe -run # 执行一次