bundles/openhab: clean up old backups before doing new ones
This commit is contained in:
parent
60c31d2d11
commit
3c4700eb6d
3 changed files with 9 additions and 5 deletions
5
bundles/openhab/files/backup-pre-hook
Normal file
5
bundles/openhab/files/backup-pre-hook
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
find /var/lib/openhab/backups -type f -mtime +3 -delete
|
||||
|
||||
/usr/share/openhab/runtime/bin/backup --full
|
|
@ -16,6 +16,10 @@ files = {
|
|||
'svc_systemd:openhab:restart',
|
||||
},
|
||||
},
|
||||
'/etc/backup-pre-hooks.d/40-openhab': {
|
||||
'source': 'backup-pre-hook',
|
||||
'mode': '0755',
|
||||
}
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
|
|
|
@ -27,11 +27,6 @@ defaults = {
|
|||
'/var/lib/openhab',
|
||||
},
|
||||
},
|
||||
'backup-client': {
|
||||
'pre-hooks': {
|
||||
'openhab': '/usr/share/openhab/runtime/bin/backup --full\n',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue