Docker Swarm Cron Executes cron jobs in a swarm environment
5.8K
Docker Swarm Cron Executes cron jobs in a swarm environment on every node running a specific container.
version: '3.7'
services:
cron:
image: pdbs/docker-swarm-cron
volumes:
- $basedir/crontab:/etc/crontab
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
deploy:
mode: global
Tasks are executed from file crontab. To execute a command with parameters in service 'servicename' every hour on a docker swarm node use the following syntax:
0 * * * * docker-swarm-exec <servicename> <command> <parameters>
The file $basedir/crontab must be accessible on every swarm node. Changes in this file are loaded on service start or by issuing the command 'crontab /etc/crontab' in every instance of the service.
Content type
Image
Digest
sha256:3ea9baa2d…
Size
141.4 MB
Last updated
almost 2 years ago
docker pull pdbs/docker-swarm-cron