Fixes #39089 - Migrate Foreman cron.d to use Foreman::Cron framework#13001
Open
archanaserver wants to merge 1 commit intotheforeman:rpm/developfrom
Open
Fixes #39089 - Migrate Foreman cron.d to use Foreman::Cron framework#13001archanaserver wants to merge 1 commit intotheforeman:rpm/developfrom
archanaserver wants to merge 1 commit intotheforeman:rpm/developfrom
Conversation
2e02756 to
6d59d98
Compare
ogajduse
reviewed
Feb 17, 2026
Member
ogajduse
left a comment
There was a problem hiding this comment.
I'd say this patch deserves a Redmine issue. Would you mind creating one?
There is not much to review from the packaging standpoint. I'd prefer someone from the Rocket team review this PR.
Replace individual task cron entries with consolidated cron:hourly, cron:daily, cron:weekly, and cron:monthly entrypoints. This leverages the Foreman::Cron framework to manage recurring tasks centrally, allowing plugins to register tasks without modifying cron files.
6d59d98 to
8686586
Compare
Author
Here it is - https://projects.theforeman.org/issues/39089 |
ogajduse
approved these changes
Feb 18, 2026
Member
ogajduse
left a comment
There was a problem hiding this comment.
Thank you, Archana.
Pending review from Rocket team.
evgeni
requested changes
Mar 2, 2026
Member
evgeni
left a comment
There was a problem hiding this comment.
This needs a revision bump and changelog entry in `foreman.spec.
But conceptually ACK, this is what we want to move towards.
| # Clean up the session entries in the database | ||
| 15 23 * * * foreman /usr/sbin/foreman-rake db:sessions:clear 2>&1 | gawk '{ print strftime("[\%Y-\%m-\%d \%H:\%M:\%S]"), $0 }' >>/var/log/foreman/cron.log | ||
| # Run hourly Foreman cron jobs | ||
| */30 * * * * foreman /usr/sbin/foreman-rake cron:hourly 2>&1 | gawk '{ print strftime("[\%Y-\%m-\%d \%H:\%M:\%S]"), $0 }' >>/var/log/foreman/cron.log |
Member
There was a problem hiding this comment.
This will trigger twice an hour: 0 and 30, you probably want
Suggested change
| */30 * * * * foreman /usr/sbin/foreman-rake cron:hourly 2>&1 | gawk '{ print strftime("[\%Y-\%m-\%d \%H:\%M:\%S]"), $0 }' >>/var/log/foreman/cron.log | |
| 30 * * * * foreman /usr/sbin/foreman-rake cron:hourly 2>&1 | gawk '{ print strftime("[\%Y-\%m-\%d \%H:\%M:\%S]"), $0 }' >>/var/log/foreman/cron.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace individual task cron entries with consolidated
cron:hourly,cron:daily,cron:weekly, andcron:monthlyentrypoints. This leverages theForeman::Cronframework to manage recurring tasks centrally, allowing plugins to register tasks without modifying cron files.