refactor: add Telegram env in Dockerfile, move telegram notification to utils

This commit is contained in:
Jonas Kaninda
2024-09-11 04:37:02 +02:00
parent 67ea22385f
commit 390e7dad0c
6 changed files with 80 additions and 85 deletions

View File

@@ -19,7 +19,7 @@ import (
)
func StartBackup(cmd *cobra.Command) {
utils.Welcome()
intro()
//Set env
utils.SetEnv("STORAGE_PATH", storagePath)
utils.GetEnv(cmd, "period", "BACKUP_CRON_EXPRESSION")
@@ -116,6 +116,13 @@ func scheduledMode(db *dbConfig, storage string) {
fmt.Println(line.Text)
}
}
func intro() {
fmt.Println()
fmt.Println("**********************************")
fmt.Println(" MySQL Backup ")
fmt.Println(" @Copyright © 2024 jkaninda ")
fmt.Println("***********************************")
}
// BackupDatabase backup database
func BackupDatabase(db *dbConfig, backupFileName string, disableCompression bool) {

View File

@@ -14,7 +14,7 @@ import (
)
func StartMigration(cmd *cobra.Command) {
utils.Welcome()
intro()
utils.Info("Starting database migration...")
//Get DB config
dbConf = getDbConfig(cmd)

View File

@@ -16,7 +16,7 @@ import (
)
func StartRestore(cmd *cobra.Command) {
utils.Welcome()
intro()
//Set env
utils.SetEnv("STORAGE_PATH", storagePath)