Add logrotate support for backup apps

This commit is contained in:
Lance Edgar 2023-02-17 11:01:29 -06:00
parent a76d38c201
commit cde124b916
2 changed files with 16 additions and 0 deletions

View file

@ -66,6 +66,7 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
everything=None, everything=None,
crontab=None, crontab=None,
runat=UNSPECIFIED, runat=UNSPECIFIED,
logrotate=False,
context={}): context={}):
""" """
Make an app which can run backups for the server. Make an app which can run backups for the server.
@ -228,3 +229,8 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
deploy(c, crontab, '/etc/cron.d/backup', context=crontab_context, use_sudo=True) deploy(c, crontab, '/etc/cron.d/backup', context=crontab_context, use_sudo=True)
else: else:
deploy_generic(c, 'backup/crontab.mako', '/etc/cron.d/backup', context=crontab_context, use_sudo=True) deploy_generic(c, 'backup/crontab.mako', '/etc/cron.d/backup', context=crontab_context, use_sudo=True)
# logrotate
if logrotate:
deploy_generic(c, 'backup/logrotate.conf', '/etc/logrotate.d/backup',
use_sudo=True)

View file

@ -0,0 +1,10 @@
/srv/envs/backup/app/log/rattail.log {
daily
missingok
rotate 30
compress
delaycompress
notifempty
create 600 rattail rattail
}