https://github.com/networkteam/minicron
A small cloud-native cron alternative to run multiple scheduled commands (especially in Docker containers)
https://github.com/networkteam/minicron
Last synced: about 2 months ago
JSON representation
A small cloud-native cron alternative to run multiple scheduled commands (especially in Docker containers)
- Host: GitHub
- URL: https://github.com/networkteam/minicron
- Owner: networkteam
- Created: 2017-09-12T12:40:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-01T07:24:27.000Z (almost 2 years ago)
- Last Synced: 2024-06-19T04:19:22.946Z (almost 2 years ago)
- Language: Go
- Size: 791 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minicron
A small cloud-native cron alternative to run multiple scheduled commands (especially in Docker containers).
## Usage
Pass multiple commands with `-c` each with `[name]`, `[schedule]` and `[command]`:
minicron -v -c sleep "@every 7s" "sleep 11"\
-c sing "0 0 12 * * 1-5" "echo Lunch"
See https://godoc.org/github.com/robfig/cron for the complete interval / schedule syntax.
Minicron will prevent multiple command executions if a command is still running. Stdout / Stderr output is combined for all commands.
Note: Commands are exec'd without a subshell.
## Running in Docker
docker pull networkteamcom/minicron
docker run -it --rm networkteamcom/minicron -v -c "test" "@every 5s" "echo Test"
But most of the time you might want to use this in a [multi-stage build](https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds) to copy the static binary to another image.