Replace housekeeping script with system job #10626

Closed
opened 2025-12-29 21:33:52 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Jan 8, 2025).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v4.2.1

Feature type

Change to existing functionality

Triage priority

I volunteer to perform this work (if approved)

Proposed functionality

Replace the standalone housekeeping management command with individual system jobs (introduced in NetBox v4.2) that run automatically at the configured interval.

The housekeeping command currently performs the following operations:

  • Clear any expired authentication sessions from the database
  • Delete any expired change log records (per the CHANGELOG_RETENTION parameter)
  • Delete any expired jobs (per the JOB_RETENTION parameter)
  • Check for any new releases (if configured)

Use case

This will obviate the need for administrators to manually configure system cron jobs to run the housekeeping command. It also allows for the individual housekeeping tasks (listed above) to be scheduled at different intervals.

Database changes

N/A

External dependencies

N/A

Originally created by @jeremystretch on GitHub (Jan 8, 2025). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v4.2.1 ### Feature type Change to existing functionality ### Triage priority I volunteer to perform this work (if approved) ### Proposed functionality Replace the standalone `housekeeping` [management command](https://github.com/netbox-community/netbox/blob/main/netbox/extras/management/commands/housekeeping.py) with individual system jobs ([introduced](https://netboxlabs.com/docs/netbox/en/stable/plugins/development/background-jobs/#system-jobs) in NetBox v4.2) that run automatically at the configured interval. The `housekeeping` command currently performs the following operations: * Clear any expired authentication sessions from the database * Delete any expired change log records (per the `CHANGELOG_RETENTION` parameter) * Delete any expired jobs (per the `JOB_RETENTION` parameter) * Check for any new releases (if configured) ### Use case This will obviate the need for administrators to manually configure system cron jobs to run the `housekeeping` command. It also allows for the individual housekeeping tasks (listed above) to be scheduled at different intervals. ### Database changes N/A ### External dependencies N/A
adam added the status: acceptedtype: featurecomplexity: medium labels 2025-12-29 21:33:52 +01:00
adam closed this issue 2025-12-29 21:33:52 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Apr 25, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Apr 25, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10626