Run periodic tasks via docker exec
Project description
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.
Source Distribution
docker_tasks-0.1.1.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for docker_tasks-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2ed24a35ba8b9bd44ba56600f2203af2792d1709d1d4c40bff736484064b2ed |
|
MD5 | 480fe2c326bec861bb6b1dd0ef6f570f |
|
BLAKE2b-256 | f2b965685cecb140e9f062a72c35fece61874c5a55ed97b77bad309e2a925cd1 |