Giter Site home page Giter Site logo

younited / pyredis-dump Goto Github PK

View Code? Open in Web Editor NEW

This project forked from muayyad-alsadi/pyredis-dump

1.0 2.0 0.0 79 KB

A Redis dump/restore tool for long-term storage

License: GNU General Public License v2.0

Python 89.54% Dockerfile 10.46%
redis-dump redis-backup backup backup-database backup-utility python redis docker

pyredis-dump's Introduction

pyredis-dump - A Redis Dump/Restore Tool

Inspired by redis-dump-load but can handle binary blobs not just text.

Dumps Redis data sets into a format suitable for long-term storage (currently Python Literals using AST) and loads data from such dump files back into Redis.

Features

  • Supports all Redis data types;
  • Dumps TTL and expiration times;
  • Can load TTL OR original expiration time for expiring keys;
  • Dumps are human readable
  • Dumps are line-aligned (can be streamed)
  • SSL support
  • Can load options from a INI configuration file
  • Can be used as a module in a larger program or as a standalone utility
  • Compatible with Docker

Python 2/3 Compatability

Use python2 for restoring dumps taken using python2 Use python3 for restoring dumps taken using python3

Basic usage

# From the command-line
$ python3 pyredis-dump.py -h
$ python3 pyredis-dump.py dblist
$ python3 pyredis-dump.py dump -o dump.outfile
$ python3 pyredis-dump.py restore -i dump.outfile
$ python3 pyredis-dump.py dblist --ssl -H my.host -w SECRET

# Using a configuration file
$ python3 pyredis-dump.py dblist -c config.ini
$ python3 pyredis-dump.py dump -c config.ini
$ python3 pyredis-dump.py restore -c config.ini

Docker usage

# Run with arguments
$ docker run --rm -it --name redis-dump ghcr.io/younited/pyredis-dump dblist -H remote.host -w SECRET
$ docker run --rm -it --name redis-dump ghcr.io/younited/pyredis-dump dump -H remote.host -w SECRET

# Run from a configuration file
$ docker run --rm -it \
  -v $(pwd)/config.ini:/app/config.ini \
  --name redis-dump ghcr.io/younited/pyredis-dump dblist -c config.ini

# Dump to host
$ docker run --rm -it \
  -v $(pwd)/config.ini:/app/config.ini \
  --name redis-dump ghcr.io/younited/pyredis-dump dump -c config.ini > /path/to/dump.outfile

# Dump to a volume
$ docker volume create myvol
$ docker run --rm -it \
  -v $(pwd)/config.ini:/app/config.ini \
  -v myvol:/data \
  --name redis-dump ghcr.io/younited/pyredis-dump dump -c config.ini -o /data/dump.outfile

# Restore from a volume
$ docker run --rm -it \
  -v $(pwd)/config.ini:/app/config.ini \
  -v myvol:/data \
  --name redis-dump ghcr.io/younited/pyredis-dump restore -c config.ini -i /data/dump.outfile

pyredis-dump's People

Contributors

dependabot[bot] avatar dysonfrost avatar muayyad-alsadi avatar

Stargazers

 avatar

Watchers

James Cloos 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.