Coder Social home page Coder Social logo

ansrivas / docker-volume-manager Goto Github PK

View Code? Open in Web Editor NEW
4.0 5.0 0.0 20 KB

Manage your named docker volumes using this simple script.

License: MIT License

Python 100.00%
docker docker-volume-manager named-docker-volumes docker-volume-plugin

docker-volume-manager's Introduction

docker-volume-manager

Manage your named docker volumes using this simple script.

Disclaimer: Do not use it directly in a production environment. Test it locally before using it out there.

Managing docker-volumes with a simple script.


Installation:

pip install docker-volume-manager

Usage:

$ docker-volume-manager --help
Usage: docker-volume-manager [OPTIONS] COMMAND [ARGS]...

  Showcase different options to backup and load docker volumes.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  load  Load the locally saved volume to named...
  save  Save your docker volume locally.

A simple use case could be to backup named docker-volumes:

# cat backup_script.py
import os
import subprocess
import time

files = os.listdir('./')
tars = [f for f in files if f.endswith('.tar.gz')]
to_keep = sorted(tars)[-7:]
for tar in tars:
    if tar not in to_keep:
        os.remove(tar)

command = ["/usr/bin/docker-volume-manager", "save", "--volume", "your_docker_data_volume", "--interactive","False"]
subprocess.check_output(command )

docker-volume-manager's People

Contributors

ansrivas avatar dependabot-preview[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-volume-manager's Issues

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.