From 0674b3f8db9716d0e8fdef76025b3a8bcf970216 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 6 Feb 2022 13:40:33 +0100 Subject: [PATCH] bundles/netbox: move housekeeping to systemd timers --- bundles/netbox/metadata.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/bundles/netbox/metadata.py b/bundles/netbox/metadata.py index ca31369..0e26b0e 100644 --- a/bundles/netbox/metadata.py +++ b/bundles/netbox/metadata.py @@ -21,14 +21,6 @@ defaults = { # and database }, }, - 'cron': { - 'jobs': { - 'netbox': '{m} {h} * * * netbox /opt/netbox/venv/bin/python /opt/netbox/src/netbox/manage.py housekeeping'.format( - m=node.magic_number%60, - h=node.magic_number%4, - ), - }, - }, 'postgresql': { 'databases': { 'netbox': { @@ -41,6 +33,16 @@ defaults = { }, }, }, + 'systemd-timers': { + 'timers': { + 'netbox_housekeeping': { + 'command': '/opt/netbox/venv/bin/python /opt/netbox/src/netbox/manage.py housekeeping', + 'pwd': '/opt/netbox', + 'user': 'netbox', + 'when': 'daily', + } + }, + }, 'zfs': { 'datasets': { 'tank/netbox': {},