Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schedule "From now" negative output #378

Closed
W1zzardTPU opened this issue Jun 30, 2024 · 2 comments · Fixed by #425
Closed

Schedule "From now" negative output #378

W1zzardTPU opened this issue Jun 30, 2024 · 2 comments · Fixed by #425
Labels
bug Something isn't working
Milestone

Comments

@W1zzardTPU
Copy link

Looks like a rounding error

│ 2024-06-30T17:25:51.406207133Z 2024/06/30 17:25:51 using configuration file: /etc/resticprofile/profiles.yaml                                                                                                                               │
│ 2024-06-30T17:25:51.415401032Z                                                                                                                                                                                                              │
│ 2024-06-30T17:25:51.415412702Z Analyzing backup schedule 1/1                                                                                                                                                                                │
│ 2024-06-30T17:25:51.415416271Z =================================                                                                                                                                                                            │
│ 2024-06-30T17:25:51.415419241Z   Original form: *:00,05,10,15,20,25,30,35,40,45,50,55                                                                                                                                                       │
│ 2024-06-30T17:25:51.415421761Z Normalized form: *-*-* *:00,05,10,15,20,25,30,35,40,45,50,55:00                                                                                                                                              │
│ 2024-06-30T17:25:51.415423711Z     Next elapse: Sun Jun 30 17:25:00 UTC 2024                                                                                                                                                                │
│ 2024-06-30T17:25:51.415425701Z        (in UTC): Sun Jun 30 17:25:00 UTC 2024                                                                                                                                                                │
│ 2024-06-30T17:25:51.415427881Z        From now: -51s left                                                                                                                                                                                   │
│ 2024-06-30T17:25:51.415429911Z                                                                                                                                                                                                              │
│ 2024-06-30T17:25:51.415557488Z 2024/06/30 17:25:51 scheduled job default/backup created                                                                                                                                                     │
│ 2024-06-30T17:25:51.420512803Z time="2024-06-30T17:25:51Z" level=info msg="read crontab: /etc/crontab"                                                                                                                                      │
@creativeprojects
Copy link
Owner

Hey!

Are you using the cron scheduler right? not systemd?

If yes I think the rounding error is likely to be there:

next := from.Truncate(time.Minute) // truncate all the seconds

Thanks for the report 👍🏻

@creativeprojects creativeprojects added the bug Something isn't working label Jun 30, 2024
@W1zzardTPU
Copy link
Author

Are you using the cron scheduler right? not systemd?

Yessir, " scheduler: crontab:-:/etc/crontab"

creativeprojects added a commit that referenced this issue Oct 28, 2024
@creativeprojects creativeprojects added this to the v0.30.0 milestone Oct 28, 2024
creativeprojects added a commit that referenced this issue Feb 14, 2025
* merge display methods

* display only if more than one

* quick fix for #378

* keep trying to remove jobs

* improve message on windows

* rename errors as schedule job

* don't ask to start the job on darwin

* improve launchd and systemd handlers

* add cron entry parser

* remove unused fields

* simplify line parsing

* add Scheduled method on systemd handler

* run tests only on os supporting systemd

* wire up Scheduled method in crond handler

* read env variables from systemd unit

* read registered tasks

* fix interval test

* add scheduled for windows

* add scheduled for windows

* use afero for crontab tests

* add config file to launchd Scheduled

* fix job tests on Windows

* add tests for systemd

* add test on Read

* fix all tests on systemd handler

* github windows agent is stupidely slow

* refactoring launchd handler

* add tests on crontab GetEntries

* remove empty Scheduler struct and call Handler directly

* removeJobs now searches for existing scheduled jobs to remove

* only display scheduled jobs in status command

* parse crontab line back into schedule event

* converts back launchd schedule into calendar event

* improve display of launchd job status

* GA is completely useless

* windows scheduler: add config file

* fix SplitArgument to run with windows folders

* fix unix tests under windows

* fix comments from AI code review

* AI nitpicking

* improve test coverage

* added new integration tests & minor refactoring

* more integration tests on create schedules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants