bundles/openhab: clean up old backups before doing new ones

This commit is contained in:
Franzi 2022-02-13 09:48:37 +01:00
parent 60c31d2d11
commit 3c4700eb6d
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 9 additions and 5 deletions

View file

@ -0,0 +1,5 @@
#!/bin/bash
find /var/lib/openhab/backups -type f -mtime +3 -delete
/usr/share/openhab/runtime/bin/backup --full

View file

@ -16,6 +16,10 @@ files = {
'svc_systemd:openhab:restart', 'svc_systemd:openhab:restart',
}, },
}, },
'/etc/backup-pre-hooks.d/40-openhab': {
'source': 'backup-pre-hook',
'mode': '0755',
}
} }
svc_systemd = { svc_systemd = {

View file

@ -27,11 +27,6 @@ defaults = {
'/var/lib/openhab', '/var/lib/openhab',
}, },
}, },
'backup-client': {
'pre-hooks': {
'openhab': '/usr/share/openhab/runtime/bin/backup --full\n',
},
},
} }