diff --git a/internal/backend/backup/jobrun.go b/internal/backend/backup/jobrun.go index 0f1d7c2..5cc6c3e 100644 --- a/internal/backend/backup/jobrun.go +++ b/internal/backend/backup/jobrun.go @@ -198,7 +198,7 @@ func RunBackup(job *store.Job, storeInstance *store.Store, waitChan chan struct{ formattedTime := time.Now().Format(time.RFC3339) select { - case <-logCtx.Done(): + case <-ctx.Done(): if !taskHasError { _, err := writer.WriteString(formattedTime + ": TASK OK\n") if err != nil { diff --git a/internal/utils/pattern_regex.go b/internal/utils/pattern_regex.go index 807d471..d14acc5 100644 --- a/internal/utils/pattern_regex.go +++ b/internal/utils/pattern_regex.go @@ -15,6 +15,9 @@ func GlobToRegex(glob string) (string, error) { glob = glob[1:] } + glob = strings.TrimSuffix(glob, "/") + glob = strings.TrimSuffix(glob, "\\") + var regex strings.Builder regex.WriteString(".*") // Match any path leading to the pattern