Skip to main content

Utilze docker exec to run commands on yaml base config

Project description

travis

docker-tasks

docker-tasks is a tool for executing periodic tasks via docker exec. It is looking up for running docker images and execute the specified commands in the matching container

An use case could be to dump all PostgreSQL based images to the container related volume. This allow me to backup /var/lib/docker/volumes/ with a pg_dump generated database dump inside my volumes.

Installation

pip install docker-tasks

Create a docker-tasks.yml with example commands

images:
    ubuntu:
      '*':
        - ps aux

    postgres:
      '9.*':
        - /bin/sh -c "pg_dump -U postgres postgres > /var/lib/postgresql/data/db_backup_$(date +%u).sql"

Usage

usage: docker-tasks [-h] [-c CONFIG] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Config yaml. Default (docker-tasks.yml)
  -v, --verbose         Increase output verbosity

Project details


Download files

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

Files for docker-tasks, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size docker_tasks-0.0.8-py3-none-any.whl (3.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size docker-tasks-0.0.8.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page