Add logrotate
support for backup apps
This commit is contained in:
parent
a76d38c201
commit
cde124b916
|
@ -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)
|
||||||
|
|
10
rattail_fabric2/deploy/backup/logrotate.conf
Normal file
10
rattail_fabric2/deploy/backup/logrotate.conf
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
/srv/envs/backup/app/log/rattail.log {
|
||||||
|
daily
|
||||||
|
missingok
|
||||||
|
rotate 30
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
notifempty
|
||||||
|
create 600 rattail rattail
|
||||||
|
}
|
Loading…
Reference in a new issue