Improve housekeeping installation instructions #5482

Closed
opened 2025-12-29 19:28:32 +01:00 by adam · 1 comment
Owner

Originally created by @abrahamvegh on GitHub (Oct 6, 2021).

Originally assigned to: @jeremystretch on GitHub.

Change Type

Correction

Area

Installation instructions

Proposed Changes

The upgrade documentation offers a copy/paste snippet for installing the included housekeeping script as a cronjob:

cp /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/

Per the manpage for Debian cron: (emphasis added)

[…] the files under these directories have to be pass some sanity checks including the following: […] the file names must conform to the filename requirements of run-parts[…]. Any file that does not conform to these requirements will not be executed by run-parts. For example, any file containing dots will be ignored. […]

I noticed on my NetBox installation that housekeeping was not being run, and this was because the script filename still had the .sh.

I suggest improving the command in the documentation thusly:

cp /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/netbox-housekeeping

It may also be prudent to include a note about cron in the same section of the documentation as the snippet, to ensure others (like me!) who may not have a nuanced knowledge of cron and run-parts are not falling into the same trap.

It also may be prudent to include logic within NetBox to detect if housekeeping has not run for some amount of ‘a long time’, which may be an indication of improper installation, or to simply provide an indication (perhaps in the footer? in settings?) of when housekeeping was last run, but that can be a separate issue.

Originally created by @abrahamvegh on GitHub (Oct 6, 2021). Originally assigned to: @jeremystretch on GitHub. ### Change Type Correction ### Area Installation instructions ### Proposed Changes The [upgrade documentation](https://github.com/netbox-community/netbox/blob/b8062200747f1733e6c8a19a53ba696ad482c564/docs/installation/upgrading.md#L117) offers a copy/paste snippet for installing the included housekeeping script as a cronjob: `cp /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/` Per the [manpage for Debian cron](https://manpages.debian.org/stretch/cron/cron.8.en.html): (emphasis added) > […] the files under these directories have to be pass some sanity checks including the following: […] the file names must conform to the filename requirements of run-parts[…]. Any file that does not conform to these requirements **will not be executed by run-parts**. For example, **any file containing dots will be ignored**. […] I noticed on my NetBox installation that housekeeping was not being run, and this was because the script filename still had the `.sh`. I suggest improving the command in the documentation thusly: `cp /opt/netbox/contrib/netbox-housekeeping.sh /etc/cron.daily/netbox-housekeeping` It may also be prudent to include a note about `cron` in the same section of the documentation as the snippet, to ensure others (like me!) who may not have a nuanced knowledge of `cron` and `run-parts` are not falling into the same trap. It also may be prudent to include logic within NetBox to detect if housekeeping has not run for some amount of ‘a long time’, which may be an indication of improper installation, or to simply provide an indication (perhaps in the footer? in settings?) of when housekeeping was last run, but that can be a separate issue.
adam added the status: acceptedtype: documentation labels 2025-12-29 19:28:32 +01:00
adam closed this issue 2025-12-29 19:28:32 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 6, 2021):

Good catch! I completely missed that when introducing the housekeeping script. Thanks for taking the time to file a bug report.

@jeremystretch commented on GitHub (Oct 6, 2021): Good catch! I completely missed that when introducing the housekeeping script. Thanks for taking the time to file a bug report.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5482