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

Can I specify a command to run once then on a schedule? #79

Open
ashleysommer opened this issue Nov 20, 2019 · 3 comments
Open

Can I specify a command to run once then on a schedule? #79

ashleysommer opened this issue Nov 20, 2019 · 3 comments

Comments

@ashleysommer
Copy link
Contributor

I'm thinking of a situation where I want to run a job once when ofelia starts up, then the same job every 60 minutes after that.

Currently if I use @hourly or @every 60m, ofelia will start up and then wait 60 minutes before running the job for the first time. I want it done now then hourly.

I admit I haven't looked too deeply into the go-cron supported commands, there might be a way to specify it that I am missing.

@taraspos
Copy link
Collaborator

Not sure if this is currently possible, but I think a new optional parameter can be added like run-on-start. If you can send a PR would be awesome, because not sure when I have time to pick that up.

Thanks.

@ashleysommer
Copy link
Contributor Author

ashleysommer commented Nov 22, 2019

Another point to make about this, is I'd like the hourly schedule to be based on when the first job is run.
For example if I start the containers at 12:45, I'd like it to run once at 12:45, then schedule each hourly job for for 13:45, 14:45 etc. Rather than 12:45, 13:00, 14:00 etc.
There is an inconsistency in the go-cron documentation, at one point it mentions @hourly is run every hour "at the top of the hour" which I guess means at 0 minutes. Then elsewhere in the docs it says @hourly is run every 60 minutes after the service starts.
Do you know which is correct?

@Tofandel
Copy link

Tofandel commented Jul 4, 2023

There is also a ton of request for this feature in the cron lib which has not yet landed

robfig/cron#436

This is what's blocking it in ofelia

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

No branches or pull requests

3 participants