Change backup folder depending on DEBUG
This commit is contained in:
parent
301b1603ef
commit
4153f7ed6e
|
@ -2,17 +2,21 @@ from django.core.management.base import BaseCommand, CommandError
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
|
|
||||||
from apiserver import secrets
|
from apiserver import secrets, settings
|
||||||
from apiserver.api import models
|
from apiserver.api import models
|
||||||
|
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
if settings.DEBUG:
|
||||||
API_FOLDER = '/opt/spaceport/apiserver'
|
API_FOLDER = '.'
|
||||||
DATA_FOLDER = '/opt/spaceport/apiserver/data'
|
DATA_FOLDER = './data'
|
||||||
BACKUP_FOLDER = '/opt/spaceport/apiserver/backups'
|
BACKUP_FOLDER = './backups'
|
||||||
|
else:
|
||||||
|
API_FOLDER = '/opt/spaceport/apiserver'
|
||||||
|
DATA_FOLDER = '/opt/spaceport/apiserver/data'
|
||||||
|
BACKUP_FOLDER = '/opt/spaceport/apiserver/backups'
|
||||||
|
|
||||||
backup_id_string = lambda x: '{}\t{}\t{}'.format(
|
backup_id_string = lambda x: '{}\t{}\t{}'.format(
|
||||||
str(now()), x['name'], x['backup_id'],
|
str(now()), x['name'], x['backup_id'],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user