Introduce a nightly maintenance command to handle recurring housekeeping tasks #4994

Closed
opened 2025-12-29 19:22:59 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jun 11, 2021).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Add a new management command (e.g. manage.py housekeeping) intended to be run nightly. This can take care of recurring tasks such as:

  • Deleting expired changelog records
  • Clearing out expired auth sessions
  • Recording usage statistics (for future purposes)

The installation and upgrade documentation will be updated to include creating a cron job to run this command nightly.

Justification

This would allow us to offload the pseudo-random clearing of expired changelog records from the middleware (see #6056), and provide a foundation for similar additional uses in future releases.

Originally created by @jeremystretch on GitHub (Jun 11, 2021). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Add a new management command (e.g. `manage.py housekeeping`) intended to be run nightly. This can take care of recurring tasks such as: - Deleting expired changelog records - Clearing out expired auth sessions - Recording usage statistics (for future purposes) The installation and upgrade documentation will be updated to include creating a cron job to run this command nightly. ### Justification This would allow us to offload the pseudo-random clearing of expired changelog records from the middleware (see #6056), and provide a foundation for similar additional uses in future releases.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 19:23:00 +01:00
adam closed this issue 2025-12-29 19:23:00 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4994