Log when running schedule

This commit is contained in:
Frederik Ring 2024-02-07 21:39:18 +01:00
parent cb31554791
commit abfeb93628

View File

@ -133,10 +133,16 @@ func (c *command) runInForeground() error {
addJob := func(config *Config) error { addJob := func(config *Config) error {
if _, err := cr.AddFunc(config.BackupCronExpression, func() { if _, err := cr.AddFunc(config.BackupCronExpression, func() {
c.logger.Info(
fmt.Sprintf(
"Now running schedule %s",
config.BackupCronExpression,
),
)
if err := runScript(config); err != nil { if err := runScript(config); err != nil {
c.logger.Error( c.logger.Error(
fmt.Sprintf( fmt.Sprintf(
"Unexpected error running schedule %v: %v", "Unexpected error running schedule %s: %v",
config.BackupCronExpression, config.BackupCronExpression,
err, err,
), ),