Provide default crontab for luigi, to rotate logs and restart
This commit is contained in:
parent
8c556e6176
commit
6fb9389e45
4
rattail_fabric2/deploy/luigi/crontab.mako
Normal file
4
rattail_fabric2/deploy/luigi/crontab.mako
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
## -*- mode: conf; -*-
|
||||||
|
|
||||||
|
# rotate logs and restart Luigi at *just before* 12:00am midnight
|
||||||
|
55 23 * * * root ${appdir}/rotate-luigi-logs.sh
|
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2022 Lance Edgar
|
# Copyright © 2010-2023 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -32,7 +32,8 @@ from rattail_fabric2 import make_deploy, mkdir
|
||||||
deploy_common = make_deploy(__file__)
|
deploy_common = make_deploy(__file__)
|
||||||
|
|
||||||
|
|
||||||
def install_luigi(c, envroot, luigi='luigi', user='rattail', db_connection=None):
|
def install_luigi(c, envroot, luigi='luigi', user='rattail', db_connection=None,
|
||||||
|
crontab=False):
|
||||||
"""
|
"""
|
||||||
Install and configure Luigi to the given virtualenv.
|
Install and configure Luigi to the given virtualenv.
|
||||||
"""
|
"""
|
||||||
|
@ -70,6 +71,9 @@ def install_luigi(c, envroot, luigi='luigi', user='rattail', db_connection=None)
|
||||||
deploy_common(c, 'luigi/rotate-logs.sh.mako', '{}/rotate-luigi-logs.sh'.format(appdir),
|
deploy_common(c, 'luigi/rotate-logs.sh.mako', '{}/rotate-luigi-logs.sh'.format(appdir),
|
||||||
use_sudo=True, owner=user,
|
use_sudo=True, owner=user,
|
||||||
context={'appdir': appdir})
|
context={'appdir': appdir})
|
||||||
|
if crontab:
|
||||||
|
deploy_common(c, 'luigi/crontab.mako', '/etc/cron.d/luigi',
|
||||||
|
use_sudo=True, context={'appdir': appdir})
|
||||||
|
|
||||||
|
|
||||||
def install_overnight_script(c, envroot, user='rattail', automation='All',
|
def install_overnight_script(c, envroot, user='rattail', automation='All',
|
||||||
|
|
Loading…
Reference in a new issue