- 当前只编译了linux版本,如需windows版本可以给一个issue
- 需要安装mysql-client 或者mariadb-client
- 如果是windows平台记得给mysqldump增加一下环境变量
ubuntu/debian系统
apt install mysql-client
centos系统
yum install mysql-client
- config 所有的配置文件
- huix.conf.demo 配置文件小样
- main.go 实现的代码文件
$ chmod +x ./backmysql
$ nohup /usr/local/backmysql/./backmysql > /var/log/backmysql.log 2>&1 &
set GOOS=linux/windows
set GOARCH=amd64/arm
go build -o backmysql main.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go && mv main backmysql
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -a backmysql main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go
修改完配置记得重新启动程序
!!
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
# 比如这里就是安装的13版本
apt install postgresql-client-13