Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Merge requests
!343
Fix backup options
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix backup options
fix/backup-options
into
master
Overview
3
Commits
4
Pipelines
2
Changes
1
All threads resolved!
Hide all comments
Merged
Jonathan Weth
requested to merge
fix/backup-options
into
master
4 years ago
Overview
3
Commits
4
Pipelines
2
Changes
1
All threads resolved!
Hide all comments
Expand
0
0
Merge request reports
Compare
master
version 1
5b450159
4 years ago
master (base)
and
latest version
latest version
aaee254d
4 commits,
4 years ago
version 1
5b450159
3 commits,
4 years ago
1 file
+
7
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
aleksis/core/tasks.py
+
7
−
5
Options
@@ -19,11 +19,13 @@ 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
media_options
=
(
"
-z
"
*
settings
.
DBBACKUP_COMPRESS_MEDIA
+
"
-e
"
*
settings
.
DBBACKUP_ENCRYPT_MEDIA
db_options
=
([
"
-z
"
]
if
settings
.
DBBACKUP_COMPRESS_DB
else
[])
+
(
[
"
-e
"
]
if
settings
.
DBBACKUP_ENCRYPT_DB
else
[]
)
media_options
=
([
"
-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
)
Loading