Skip to main content

datamaker backup

Project description

Installation

.env

.env 파일에 아래 환경변수를 적절히 활용

ENABLE_RESTORE

true|false

dbrestore, mediarestore 사용 가능 여부. 주로 production 환경에서는 비활성화.

Default: false

ENABLE_BACKUP

true|false

dbbackup, mediabackup 사용 가능 여부. 주로 development 환경에서는 비활성화.

Default: false

RESTORE_DATA_ONLY

true|false

dbrestore시 schema는 그대로 두고 data만 복원할지 여부.

아직까지는 해당 옵션을 활성화 할 경우 복원할 db에 data가 모두 삭제된 상태로 두어야 함.

Default: false

RESTORE_OPTIONS

comma separated list of pg_restore option names

Example: clean,create

Default:

  • RESTORE_DATA_ONLYtrue일 때에는 data-only,disable-triggers,exit-on-error
  • RESTORE_DATA_ONLYfalse일 때에는 clean,create,exit-on-error

settings.py

settings.py에 아래 내용 추가

from datamaker_backup import get_backup_settings

...

INSTALLED_APPS = (
    ...
    'dbbackup',  # django-dbbackup
)

...


# datamaker-backup
# https://github.com/datamaker-kr/datamaker-backup

BACKUP_CONFIG = get_backup_settings('<repository-name>', env)
vars().update(BACKUP_CONFIG)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datamaker-backup-0.1.2.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

datamaker_backup-0.1.2-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page