diff --git a/CHANGELOG.md b/CHANGELOG.md index 7227cd5..5525f69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.0-alpha.2] - 2021-12-26 + +* Add additional log statements to make debugging easier. + ## [0.1.0-alpha.1] - 2021-12-26 ### Added @@ -17,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 docker images. Currently only `linux/amd64` is supported. `linux/arm64` will be supported once I have the ability to test it. -[Unreleased]: https://github.com/fhofherr/rsched/compare/v0.1.0-alpha.1...HEAD +[Unreleased]: https://github.com/fhofherr/rsched/compare/v0.1.0-alpha.2...HEAD +[0.1.0-alpha.2]: https://github.com/fhofherr/rsched/compare/v0.1.0-alpha.1...v0.1.0-alpha.2 [0.1.0-alpha.1]: https://github.com/fhofherr/rsched/compare/v0.0.0...v0.1.0-alpha.1 [0.0.0]: https://github.com/fhofherr/rsched/releases/tag/v0.0.0 diff --git a/internal/cmd/rsched.go b/internal/cmd/rsched.go index f210ca5..6efdf61 100644 --- a/internal/cmd/rsched.go +++ b/internal/cmd/rsched.go @@ -15,6 +15,7 @@ type RSched struct { func (r *RSched) Run(cfg Config) { env := Environ() + log.Printf("Rsched version %s", Version) if cfg.ResticRepository != "" && env[restic.EnvResticRepository] == "" { env[restic.EnvResticRepository] = cfg.ResticRepository } diff --git a/internal/restic/scheduler.go b/internal/restic/scheduler.go index db73ad3..24c9850 100644 --- a/internal/restic/scheduler.go +++ b/internal/restic/scheduler.go @@ -40,6 +40,7 @@ type Scheduler struct { // See the documentation of the Scheduler type for the definition of schedule. func (s *Scheduler) ScheduleBackup(schedule, path string, os ...Option) error { return s.scheduleFunc(schedule, func(ctx context.Context) { + log.Println("Beginning backup") if err := s.BackupFunc(ctx, path, os...); err != nil { var rErr Error @@ -47,7 +48,9 @@ func (s *Scheduler) ScheduleBackup(schedule, path string, os ...Option) error { if errors.As(err, &rErr) && len(rErr.Stderr) > 0 { log.Printf("Restic stderr: %s", string(rErr.Stderr)) } + return } + log.Println("Backup successfully completed") }) } @@ -79,6 +82,7 @@ func (s *Scheduler) Shutdown() { func (s *Scheduler) scheduleFunc(schedule string, f func(context.Context)) error { s.init() + log.Printf("Adding job with schedule %q", schedule) job := s.newJob(f) if schedule == ScheduleOnce { go job()