Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include cron examples for schedule creation #331

Merged
merged 1 commit into from Feb 28, 2018

Conversation

lypht
Copy link
Contributor

@lypht lypht commented Feb 26, 2018

Signed-off-by: Josh Hull josh.hull@lypht.com

Copy link
Contributor

@ncdc ncdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to edit

https://github.com/heptio/ark/blob/530e22939de5ef060b81b20d63dcfdb294c16a5a/pkg/cmd/cli/schedule/create.go#L39-L40

Probably need to add Long and Example to it. Once you've done that, make update will regenerate docs for you (or just hack/update-generated-docs.sh).

```
ark create schedule --schedule="15 * * * *" bar
```
This would schedule a backup named `bar` that would run every fifteen minutes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs at the 15th minute of every hour, not every 15 minutes

| Character Position | Character Period | Acceptable Values |
| -------------------|:----------------:| -----------------:|
| 1 | Minute | 0-59,* |
| 2 | Hour | 0-23,* (UTC) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why you mention UTC here?

@@ -7,10 +7,32 @@ Create a schedule

Create a schedule

The schedule period is a required flag. Notation for the schedule implements cron notation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this?

The --schedule flag is required, in cron notation:

| 4 | Month | 1-12,* |
| 5 | Day of Week | 0-7,* |`,

Example: `ark create schedule --schedule=0 */6 * * * foo`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need ' or " around the cron expression

@ncdc
Copy link
Contributor

ncdc commented Feb 27, 2018

FYI, we support everything our cron library does (https://godoc.org/github.com/robfig/cron#ParseStandard).

Signed-off-by: Josh Hull <josh.hull@lypht.com>
@skriss
Copy link
Member

skriss commented Feb 28, 2018

LGTM. Thanks for the contribution @lypht!!

@skriss skriss merged commit 975dce9 into vmware-tanzu:master Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants