Add script and command for creating backups

This commit is contained in:
2020-02-16 02:37:22 +00:00
parent 3f37dd8940
commit 8c630ada1f
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
from django.core.management.base import BaseCommand, CommandError
from django.core.cache import cache
class Command(BaseCommand):
help = 'Record where the last backup was saved.'
def add_arguments(self, parser):
parser.add_argument('backup_path', type=str)
def handle(self, *args, **options):
backup_path = options['backup_path']
cache.set('backup_path', backup_path)
self.stdout.write('Set backup path to: ' + backup_path)