Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mr-ingenious/docker-periodicrunner
small docker image to run scripts periodically
https://github.com/mr-ingenious/docker-periodicrunner
Last synced: 15 days ago
JSON representation
small docker image to run scripts periodically
- Host: GitHub
- URL: https://github.com/mr-ingenious/docker-periodicrunner
- Owner: mr-ingenious
- License: gpl-3.0
- Created: 2024-02-25T09:33:28.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-26T23:33:58.000Z (9 months ago)
- Last Synced: 2024-02-27T00:34:59.526Z (9 months ago)
- Language: Shell
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-periodicrunner
This is a small docker image to run scripts periodically. The image is based on the python alpine image.
After startup, the image executes scripts which are located in ```/etc/periodic``` sub folders at defined intervals.## Directory structure of /etc/periodic
The volume mounted at ```/etc/periodic``` is structured as shown below. The image will execute all scripts located in
the respective folders at the given intervals. For example, all scripts in ```/etc/periodic/1min``` are executed every minute.```
/etc/periodic/1min
/etc/periodic/5min
/etc/periodic/15min
/etc/periodic/30min
/etc/periodic/hourly
/etc/periodic/weekly
/etc/periodic/monthly
```## Defining activities after startup
If additional activities shall be performed after startup, these steps can be defined with a script ```startup.sh``` which
resides in ```/opt/startup```.The variable ```RUN_ON_STARTUP``` allows executing the scripts located in one of the subfolders in ```/etc/periodic``` directly
after startup.
For example, setting ```RUN_ON_STARTUP=1min``` directly executes all scripts in ```/etc/periodic/1min``` after starting up.Please note, that all scripts must be set executable!
## Adding further assets
The directory ```/opt/additional``` allows adding further scripts or additional assets. This can be useful for helper scripts
that are called by the scripts in ```/etc/periodic```.# Docker Compose example:
```
version: '3.9'services:
periodicrunner:
image: xxx/periodicrunner:latest
container_name: prunner
restart: unless-stopped
hostname: prunner-service
environment:
- RUN_ON_STARTUP=1min 15min 30min
volumes:
- /path/to/periodic:/etc/periodic
- /path/to/additional:/opt/additional
- /path/to/startup:/opt/startup
```