Skip to content
Snippets Groups Projects
Verified Commit d7df7e30 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files
parent 553117fe
No related branches found
No related tags found
1 merge request!77Remove django-dbbackup for now.
Pipeline #419 failed
from django.conf import settings
from django.core import management
from django_cron import CronJobBase, Schedule
class Backup(CronJobBase):
RUN_AT_TIMES = settings.DBBACKUP_CRON_TIMES
RETRY_AFTER_FAILURE_MINS = 5
schedule = Schedule(
run_at_times=RUN_AT_TIMES, retry_after_failure_mins=RETRY_AFTER_FAILURE_MINS
)
code = "biscuit.core.Backup"
def do(self):
management.call_command("dbbackup", "-z")
management.call_command("mediabackup", "-z")
......@@ -53,7 +53,6 @@ INSTALLED_APPS = [
"settings_context_processor",
"sass_processor",
"easyaudit",
"dbbackup",
"dbsettings",
"django_cron",
"bootstrap4",
......@@ -298,14 +297,6 @@ IMPERSONATE = {"USE_HTTP_REFERER": True, "REQUIRE_SUPERUSER": True, "ALLOW_SUPER
DJANGO_TABLES2_TEMPLATE = "django_tables2/bootstrap4.html"
DBBACKUP_STORAGE = _settings.get("backup.storage", "django.core.files.storage.FileSystemStorage")
DBBACKUP_STORAGE_OPTIONS = {"location": _settings.get("backup.location", "/var/backups/biscuit")}
DBBACKUP_CLEANUP_KEEP = _settings.get("backup.keep.database", 10)
DBBACKUP_CLEANUP_KEEP_MEDIA = _settings.get("backup.keep.media", 10)
DBBACKUP_CRON_TIMES = _settings.get("backup.times", None) or ["03:57"]
CRON_CLASSES = ["biscuit.core.cronjobs.Backup"]
ANONYMIZE_ENABLED = _settings.get("maintenance.anonymisable", True)
LOGIN_URL = "two_factor:login"
......
......@@ -44,24 +44,4 @@
</li>
</ul>
</div>
<div class="card">
<div class="card-header bg-light text-dark">
{% blocktrans %}Recent backup cron jobs{% endblocktrans %}
</div>
<ul class="list-group list-group-flush">
{% for backup in backups %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<div>
<p>{{ backup.end_time }}</p>
</div>
{% if backup.is_success %}
<span class="badge badge-success mdi mdi-check"> </span>
{% else %}
<span class="badge badge-danger mdi mdi-error"> </span>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
......@@ -268,19 +268,6 @@ version = "0.5.1"
Django = ">=1.8.0"
django-common-helpers = ">=0.6.4"
[[package]]
category = "main"
description = "Management commands to help backup and restore a project database and media"
name = "django-dbbackup"
optional = false
python-versions = "*"
version = "3.2.0"
[package.dependencies]
Django = ">=1.5"
pytz = "*"
six = "*"
[[package]]
category = "main"
description = "Application settings whose values can be updated while a project is up and running."
......@@ -1775,9 +1762,6 @@ django-common-helpers = [
django-cron = [
{file = "django-cron-0.5.1.tar.gz", hash = "sha256:08d22708c8b2ecab8cda989019a66c7e1e2424c59d822796fd45abf7731d261d"},
]
django-dbbackup = [
{file = "django-dbbackup-3.2.0.tar.gz", hash = "sha256:9470e5d8bdaee4feb878b1b66c59eb9b27a131cccd648bf7cbfe70930acd4fc0"},
]
django-dbsettings = [
{file = "django-dbsettings-0.11.0.tar.gz", hash = "sha256:e3147ced54b7db3371df10df8845e4514aeae96720000bca1a01d0a6490a1404"},
]
......
......@@ -42,7 +42,6 @@ easy-thumbnails = "^2.6"
django-image-cropping = "^1.2"
django-impersonate = "^1.4"
python-memcached = "^1.59"
django-dbbackup = "^3.2"
django-cron = "^0.5.1"
django-hattori = "^0.2"
psycopg2 = "^2.8"
......
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