This app reads a crontab file and makes runs it just like crond
would.
The reason this app was created is specifically geared towards the use in a Docker container:
go-cron
can run as non-root (crond
wants to create a PID file and can only run as root)go-cron
can run with per second accuracy if the crontab has 6 time fragmentsgo-cron
is not strict about the ownership and permissions of the crontab files.
- Build a binary using
go build
- Now you have
go-cron
as an executable binary
./go-cron -file crontab.txt
Consider using dumb-init
to prevent zombie processes. I'm not sure if it is needed, as my understanding of the init system is limited, but using dumb-init
does not hurt either.
/usr/bin/dumb-init -- ./go-cron -file crontab.txt