Merge pull request #85 from jkaninda/docs

Docs
This commit is contained in:
Jonas Kaninda
2024-09-12 06:34:32 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
# MySQL Backup # MySQL Backup
MySQL Backup is a Docker container image that can be used to backup and restore MySQL database. It supports local storage, AWS S3 or any S3 Alternatives for Object Storage, and SSH compatible storage. MySQL Backup is a Docker container image that can be used to backup, restore and migrate MySQL database. It supports local storage, AWS S3 or any S3 Alternatives for Object Storage, and SSH compatible storage.
It also supports __encrypting__ your backups using GPG. It also supports __encrypting__ your backups using GPG.
The [jkaninda/mysql-bkup](https://hub.docker.com/r/jkaninda/mysql-bkup) Docker image can be deployed on Docker, Docker Swarm and Kubernetes. The [jkaninda/mysql-bkup](https://hub.docker.com/r/jkaninda/mysql-bkup) Docker image can be deployed on Docker, Docker Swarm and Kubernetes.

View File

@@ -247,6 +247,8 @@ func s3Backup(db *dbConfig, backupFileName string, disableCompression bool, prun
//Delete temp //Delete temp
deleteTemp() deleteTemp()
} }
// sshBackup backup database to SSH remote server
func sshBackup(db *dbConfig, backupFileName, remotePath string, disableCompression bool, prune bool, backupRetention int, encrypt bool) { func sshBackup(db *dbConfig, backupFileName, remotePath string, disableCompression bool, prune bool, backupRetention int, encrypt bool) {
utils.Info("Backup database to Remote server") utils.Info("Backup database to Remote server")
//Backup database //Backup database
@@ -282,6 +284,8 @@ func sshBackup(db *dbConfig, backupFileName, remotePath string, disableCompressi
//Delete temp //Delete temp
deleteTemp() deleteTemp()
} }
// encryptBackup encrypt backup
func encryptBackup(backupFileName string) { func encryptBackup(backupFileName string) {
gpgPassphrase := os.Getenv("GPG_PASSPHRASE") gpgPassphrase := os.Getenv("GPG_PASSPHRASE")
err := Encrypt(filepath.Join(tmpPath, backupFileName), gpgPassphrase) err := Encrypt(filepath.Join(tmpPath, backupFileName), gpgPassphrase)