Container: Add parameter to only schedule if it is a certain day #605
Labels
Comments
MrSeccubus
added a commit
that referenced
this issue
Nov 13, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order to do "First Monday of the month" type scheduling in Kubernetes I would like the scan command in a container to accept a third parameter that instructs the container to only run the scan if today is a Mon, Tue, , etc.
Rationel: Like corn, Kubernetes cronjobs interpret the schedule
0 1 1-7 * Mon cmd
as runcmd
at 01:00 on day 1 through 7 of the month AND every Monday.Normally this get's fixed in cron as:
0 1 1-7 * * [ "$(date '+\%a')" == "Mon" ] && cmd
, but that is hard to do in Kubernetes. So we need to incorportate the[ "$(date '+\%a')" == "Mon" ] &&
function into entrypoint.shThe text was updated successfully, but these errors were encountered: