2022-11-20 14:56:40 +05:00
|
|
|
Type = "cmd" # command execution
|
|
|
|
Category = "Test jobs" # jobs category name
|
|
|
|
Description = "print 'Hello' every minute" # job description
|
|
|
|
Cron = "* * * * *" # cron instructions
|
|
|
|
|
|
|
|
Command = "echo Hello" # command to execute
|
2024-03-28 09:33:15 +05:00
|
|
|
WorkingDir = "/tmp" # working directory
|
2022-11-20 14:56:40 +05:00
|
|
|
|
|
|
|
NumberOfRestartAttemts = 3 # number of restart attemts
|
|
|
|
RestartSec = 5 # the time to sleep before restarting a job (seconds)
|
|
|
|
RestartRule = "on-error" # Configures whether the job shall be restarted when the job process exits
|
|
|
|
|
|
|
|
OnSuccessCmd = "echo 'Job finished.'" # execute cmd on job success
|
|
|
|
OnErrorCmd = "echo 'Error occurred: {{.Error}}'" # execute cmd on job error
|
|
|
|
|
|
|
|
# HTTP client callbacks
|
|
|
|
OnSuccessHttpGetUrl = "http://127.0.0.1/alerts?title={{.JobName}}%20finished"
|
|
|
|
OnErrorHttpGetUrl = "http://127.0.0.1/alerts?title={{.JobName}}%20failed&message={{.Error}}&tags=warning"
|
|
|
|
|
|
|
|
OnSuccessHttpPostUrl = "http://127.0.0.1/alerts"
|
|
|
|
OnSuccessMessageFmt = "Job {{.JobName}} finished."
|
|
|
|
|
|
|
|
OnErrorHttpPostUrl = "http://127.0.0.1/alerts"
|
|
|
|
OnErrorMessageFmt = "Job {{.JobName}} failed:\n\n{{.Error}}"
|