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

handle system date changes #16

Open
hcodina opened this issue Oct 11, 2018 · 2 comments
Open

handle system date changes #16

hcodina opened this issue Oct 11, 2018 · 2 comments

Comments

@hcodina
Copy link

hcodina commented Oct 11, 2018

Hi,
I have a problematic use case and before i fill a github issue, i would like to know your opinion about it.

Let's say we are the October 11 2018.
I have cron jobs scheduled "@hourly" and "@daily" and everything is correct.

I manually change my system date and i set it to January 01 2000.
I have the impression that my jobs will never be run until October 2018 (18 years to wait).
I expect my job to be scheduled one hour or one day after their last run or at least one hour one day after my date change
but not 18 year.

I would like to known what kind of workaround we can do to handle this use case.

In main.c you handle "big" delta as :

if (dt < -60*60 || dt > 60*60) {
	t1 = t2;
	printlogf(LOG_NOTICE,"time disparity of %d minutes detected\n", dt / 60);
}

Maybe we can add something to fix cl_LastRan + timestamp file, cl_NotUntil values in this block.

What do you think about this idea ?
Do you have any other idea to handle system date changes in order to keep @xxxx jobs scheduled hourly, daily, ... ?

Best regards,
Herve Codina

@dubiousjim
Copy link
Owner

dubiousjim commented Oct 11, 2018 via email

@hcodina
Copy link
Author

hcodina commented Oct 11, 2018

Sounds good.

We can check timestamp when we read it (ie ReadTimestamps())
It seems a good place to update "invalid" timestamp.

We can plan to force a ReadTimestsamps() also on "big" delta detected in order to update "invalid" timestamp as we detect a potential date change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants