Skip to content

Commit e5bc35f

Browse files
Fix cron example in script documentation (#522)
* Fix cron example in script documentation Swapped minutes/seconds on the 9:30 AM example * fix: also update source for cron example The docs change was correct but the source in provider/script.go was omitted. For 6-field cron (seconds minutes hours day month weekday), 9:30 AM is `0 30 9 * * 1-5` not `30 0 9 * * 1-5`. Run make gen to keep docs in sync.
1 parent fd21951 commit e5bc35f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/resources/script.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ resource "coder_script" "shutdown" {
8989

9090
### Optional
9191

92-
- `cron` (String) The cron schedule to run the script on. This uses a 6-field cron expression format: `seconds minutes hours day-of-month month day-of-week`. Note that this differs from the standard Unix 5-field format by including seconds as the first field. Examples: `"0 0 22 * * *"` (daily at 10 PM), `"0 */5 * * * *"` (every 5 minutes), `"30 0 9 * * 1-5"` (weekdays at 9:30 AM).
92+
- `cron` (String) The cron schedule to run the script on. This uses a 6-field cron expression format: `seconds minutes hours day-of-month month day-of-week`. Note that this differs from the standard Unix 5-field format by including seconds as the first field. Examples: `"0 0 22 * * *"` (daily at 10 PM), `"0 */5 * * * *"` (every 5 minutes), `"0 30 9 * * 1-5"` (weekdays at 9:30 AM).
9393
- `icon` (String) A URL to an icon that will display in the dashboard. View built-in icons [here](https://github.com/coder/coder/tree/main/site/static/icon). Use a built-in icon with `"${data.coder_workspace.me.access_url}/icon/<path>"`.
9494
- `log_path` (String) The path of a file to write the logs to. If relative, it will be appended to tmp.
9595
- `run_on_start` (Boolean) This option defines whether or not the script should run when the agent starts. The script should exit when it is done to signal that the agent is ready.

provider/script.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func scriptResource() *schema.Resource {
9999
ForceNew: true,
100100
Type: schema.TypeString,
101101
Optional: true,
102-
Description: "The cron schedule to run the script on. This uses a 6-field cron expression format: `seconds minutes hours day-of-month month day-of-week`. Note that this differs from the standard Unix 5-field format by including seconds as the first field. Examples: `\"0 0 22 * * *\"` (daily at 10 PM), `\"0 */5 * * * *\"` (every 5 minutes), `\"30 0 9 * * 1-5\"` (weekdays at 9:30 AM).",
102+
Description: "The cron schedule to run the script on. This uses a 6-field cron expression format: `seconds minutes hours day-of-month month day-of-week`. Note that this differs from the standard Unix 5-field format by including seconds as the first field. Examples: `\"0 0 22 * * *\"` (daily at 10 PM), `\"0 */5 * * * *\"` (every 5 minutes), `\"0 30 9 * * 1-5\"` (weekdays at 9:30 AM).",
103103
ValidateFunc: func(i interface{}, _ string) ([]string, []error) {
104104
v, ok := i.(string)
105105
if !ok {

0 commit comments

Comments
 (0)