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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docker_tasks-0.1.1.tar.gz.
File metadata
- Download URL: docker_tasks-0.1.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.6 Linux/6.1.64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ecad2fa26304bc61ce4eeefad0d915561b1372724729f0e521691d583926d9a
|
|
| MD5 |
9e613fbb57ae6ebc5694b4494c8fc6c9
|
|
| BLAKE2b-256 |
5c472d0b88bf0e74e0eda45ea4f0fb3d5413f04a3c15b5f26c0115bcd3747199
|
File details
Details for the file docker_tasks-0.1.1-py3-none-any.whl.
File metadata
- Download URL: docker_tasks-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.6 Linux/6.1.64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2ed24a35ba8b9bd44ba56600f2203af2792d1709d1d4c40bff736484064b2ed
|
|
| MD5 |
480fe2c326bec861bb6b1dd0ef6f570f
|
|
| BLAKE2b-256 |
f2b965685cecb140e9f062a72c35fece61874c5a55ed97b77bad309e2a925cd1
|