feat(scripts): Suppress housekeeping cron output

Allow optional logging in the NetBox housekeeping script.
Users can choose silent execution or log to a file.
This commit is contained in:
Martin Hauser 2025-05-28 09:50:25 +02:00
parent cc099e86e1
commit c4a23af740
No known key found for this signature in database

View File

@ -6,4 +6,16 @@
#
# If NetBox has been installed into a nonstandard location, update the paths
# below.
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py housekeeping
# By default, all output is discarded. Uncomment the log lines below to enable
# logging.
# Run quietly (no log)
# --------------------
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py housekeeping > /dev/null 2>&1
# Run with logging (append output to log file)
# --------------------------------------------
# LOGFILE="/var/log/netbox/housekeeping.log"
# echo "[$(date)] Starting NetBox housekeeping..." >> "$LOGFILE"
# /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py housekeeping >> "$LOGFILE" 2>&1
# echo "[$(date)] NetBox housekeeping complete." >> "$LOGFILE"