diff --git a/bundles/openhab/files/backup-pre-hook b/bundles/openhab/files/backup-pre-hook new file mode 100644 index 0000000..fbf0eda --- /dev/null +++ b/bundles/openhab/files/backup-pre-hook @@ -0,0 +1,5 @@ +#!/bin/bash + +find /var/lib/openhab/backups -type f -mtime +3 -delete + +/usr/share/openhab/runtime/bin/backup --full diff --git a/bundles/openhab/items.py b/bundles/openhab/items.py index af274c2..eabe1d0 100644 --- a/bundles/openhab/items.py +++ b/bundles/openhab/items.py @@ -16,6 +16,10 @@ files = { 'svc_systemd:openhab:restart', }, }, + '/etc/backup-pre-hooks.d/40-openhab': { + 'source': 'backup-pre-hook', + 'mode': '0755', + } } svc_systemd = { diff --git a/bundles/openhab/metadata.py b/bundles/openhab/metadata.py index 4e3dafb..01abb5b 100644 --- a/bundles/openhab/metadata.py +++ b/bundles/openhab/metadata.py @@ -27,11 +27,6 @@ defaults = { '/var/lib/openhab', }, }, - 'backup-client': { - 'pre-hooks': { - 'openhab': '/usr/share/openhab/runtime/bin/backup --full\n', - }, - }, }