Code Monkey home page Code Monkey logo

django-dbdump's Introduction

# django_dbdump

Yet another Django DB Backup tool. Tested with Django==1.9.1

Features

  • rsync
  • restore from rsync
  • database & user create scripts
  • gzip

Requirements

  • pexpect

Installation

pip install pexpect
pip install -e git+https://github.com/night-crawler/django-dbdump.git@#egg=django-dbdump

Default settings

  • DBDUMP_DIR: use provided directory, or os.path.join(BASE_DIR, 'dbdump')
  • DBDUMP_BACKENDS: custom backends, i.e. {'django.db.backends.postgresql': 'django_dbdump.backends.psycopg2:DumpConverter'}
  • DBDUMP_STRFTIME_FORMAT = '%Y-%m-%d-%H%M%S'
  • DBDUMP_COMPRESS_ENABLED = True
  • DBDUMP_COMPRESS_COMMAND = 'gzip -f -9 %s'
  • DBDUMP_DECOMPRESS_COMMAND = 'gzip -d %s'
  • DBDUMP_COMPRESS_EXTENSION = '.gz'
  • DBDUMP_MAX_DUMPS_PER_ALIAS = 10 store max N dumps
  • DBDUMP_RSYNC_ENABLED = False - rsync disabled by default
  • DBDUMP_RSYNC_PATTERN = 'rsync -raz --progress %(source)s %(destination)s'
  • DBDUMP_RSYNC_DESTINATION = '[email protected]:/backups/'
  • DBDUMP_RSYNC_PASSWORD = '' - rsync password, if empty suppose we're using key auth
  • DBDUMP_RSYNC_DELETE = True - remove destination files

Usage

./manage.py dbdump
--create              Show create statements
--load                Load database from last dump
--start-rsync         Start rsync and exit
--rsync-restore       Restore dumps from rsync
--max-dumps [MAX_DUMPS]
                      Max dumps per alias
--rsync               Run rsync after dump
--no-rsync            Do NOT run rsync after dump

django-dbdump's People

Contributors

night-crawler avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.