diff --git a/handlers/filesystem.go b/handlers/filesystem.go index 825ea16..5cfdc08 100644 --- a/handlers/filesystem.go +++ b/handlers/filesystem.go @@ -110,3 +110,7 @@ func copyFile(src, dst string) error { _, err = io.Copy(destination, source) return err } + +func (h *FileSystemHandler) Name() string { + return "Filesystem Backup" +} diff --git a/handlers/handler.go b/handlers/handler.go index 9ffae50..9bda844 100644 --- a/handlers/handler.go +++ b/handlers/handler.go @@ -4,4 +4,5 @@ import "context" type BackupHandler interface { Backup(ctx context.Context) (string, error) + Name() string } diff --git a/handlers/mysql.go b/handlers/mysql.go index e1719ad..caf9a63 100644 --- a/handlers/mysql.go +++ b/handlers/mysql.go @@ -41,3 +41,7 @@ func (h *MySQLHandler) Backup(ctx context.Context) (string, error) { return filename, nil } + +func (h *MySQLHandler) Name() string { + return "MySQL Backup" +} diff --git a/sentinel/main.go b/sentinel/main.go index 1e27641..7d6fdbb 100644 --- a/sentinel/main.go +++ b/sentinel/main.go @@ -104,7 +104,7 @@ func performBackup(handlerList []handlers.BackupHandler, uploader *storage.S3Upl wg.Add(1) go func(handler handlers.BackupHandler) { defer wg.Done() - + fmt.Printf("Performing backup: %s\n", handler.Name()) backupFile, err := handler.Backup(ctx) if err != nil { errors <- err