Skip to content
Snippets Groups Projects
Verified Commit 6305f6dd authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix options for dbbackup

parent 29428e7b
No related branches found
No related tags found
1 merge request!343Fix backup options
......@@ -19,11 +19,21 @@ def send_notification(notification: int, resend: bool = False) -> None:
def backup_data() -> None:
"""Backup database and media using django-dbbackup."""
# Assemble command-line options for dbbackup management command
db_options = "-z " * settings.DBBACKUP_COMPRESS_DB + "-e" * settings.DBBACKUP_ENCRYPT_DB
db_options = (
["-z"]
if settings.DBBACKUP_COMPRESS_DB
else [] + ["-e"]
if settings.DBBACKUP_ENCRYPT_DB
else []
)
media_options = (
"-z " * settings.DBBACKUP_COMPRESS_MEDIA + "-e" * settings.DBBACKUP_ENCRYPT_MEDIA
["-z"]
if settings.DBBACKUP_COMPRESS_MEDIA
else [] + "-e"
if settings.DBBACKUP_ENCRYPT_MEDIA
else []
)
# Hand off to dbbackup's management commands
management.call_command("dbbackup", db_options)
management.call_command("mediabackup", media_options)
management.call_command("dbbackup", *db_options)
management.call_command("mediabackup", *media_options)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment