core(major): add integrated database backup

This commit is contained in:
Langhammer, Jens
2019-10-15 13:52:33 +02:00
parent 8bdf12cff1
commit 4086252979
5 changed files with 112 additions and 43 deletions

13
passbook/lib/tasks.py Normal file
View File

@ -0,0 +1,13 @@
"""passbook misc tasks"""
from django.core import management
from structlog import get_logger
from passbook.root.celery import CELERY_APP
LOGGER = get_logger()
@CELERY_APP.task()
def backup_database():
"""Backup database"""
management.call_command('dbbackup')
LOGGER.info('Successfully backed up database.')