bundles/backup-client: do logging
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
3fc51d9eba
commit
fa4fe51155
3 changed files with 17 additions and 1 deletions
10
bundles/backup-client/files/logrotate.conf
Normal file
10
bundles/backup-client/files/logrotate.conf
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
/var/log/backup-client/*.log {
|
||||||
|
compress
|
||||||
|
copytruncate
|
||||||
|
daily
|
||||||
|
dateext
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
rotate 14
|
||||||
|
sharedscripts
|
||||||
|
}
|
|
@ -47,10 +47,16 @@ files['/usr/local/share/icinga/plugins/check_backup_last_run'] = {
|
||||||
'mode': '0755',
|
'mode': '0755',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
files['/etc/logrotate.d/backup-client'] = {
|
||||||
|
'source': 'logrotate.conf',
|
||||||
|
}
|
||||||
|
|
||||||
directories['/etc/backup-pre-hooks.d'] = {
|
directories['/etc/backup-pre-hooks.d'] = {
|
||||||
'purge': True,
|
'purge': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
directories['/var/log/backup-client'] = {}
|
||||||
|
|
||||||
for hname, hcontent in node.metadata.get('backup-client/pre-hooks', {}).items():
|
for hname, hcontent in node.metadata.get('backup-client/pre-hooks', {}).items():
|
||||||
files[f'/etc/backup-pre-hooks.d/50-{hname}'] = {
|
files[f'/etc/backup-pre-hooks.d/50-{hname}'] = {
|
||||||
'content': '#!/bin/sh\n\n' + hcontent,
|
'content': '#!/bin/sh\n\n' + hcontent,
|
||||||
|
|
|
@ -19,7 +19,7 @@ def cron(metadata):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'cron': {
|
'cron': {
|
||||||
'backup': '{} 23 * * * root /usr/local/bin/generate-backup > /dev/null 2>&1'.format(
|
'backup': '{} 23 * * * root /usr/local/bin/generate-backup > /var/log/backup-client/backup.log 2>&1'.format(
|
||||||
(node.magic_number % 60),
|
(node.magic_number % 60),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue