Skip to content

Commit

Permalink
Log when running schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 committed Feb 7, 2024
1 parent cb31554 commit abfeb93
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/backup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,16 @@ func (c *command) runInForeground() error {

addJob := func(config *Config) error {
if _, err := cr.AddFunc(config.BackupCronExpression, func() {
c.logger.Info(
fmt.Sprintf(
"Now running schedule %s",
config.BackupCronExpression,
),
)
if err := runScript(config); err != nil {
c.logger.Error(
fmt.Sprintf(
"Unexpected error running schedule %v: %v",
"Unexpected error running schedule %s: %v",
config.BackupCronExpression,
err,
),
Expand Down

0 comments on commit abfeb93

Please sign in to comment.