Skip to content

NetBox housekeeping cron job logs in email #9162

Answered by mtinberg
ShreyasSurendra asked this question in Q&A
Discussion options

You must be logged in to vote

Cron configuration is not really within the scope of Netbox itself, it's a system service that many things use (see man 5 crontab for the full documentation), but one technique I use when I don't want to get the default reporting emails with the script output is to pipe to /usr/bin/logger to convert the output to syslog messages eg.

#Ansible: Netbox daily housekeeping
@daily netbox /opt/netbox/current/venv-py3/bin/python /opt/netbox/current/netbox/manage.py housekeeping | /usr/bin/logger -p daemon.info -t netbox-housekeeping 2>&1

that keeps my inbox smaller and if I do need to look a the output of a historical run of the script, I can get it from the logs with the normal retention rules …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@candlerb
Comment options

@larsen0815
Comment options

Answer selected by ShreyasSurendra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants