mirror of
https://github.com/nxshock/gron.git
synced 2025-07-01 00:13:36 +05:00
Move job examples to separate dir
This commit is contained in:
parent
d9d9f0dcf0
commit
efa20ae0f0
4 changed files with 37 additions and 39 deletions
23
_jobExamples/advanced.conf
Normal file
23
_jobExamples/advanced.conf
Normal file
|
@ -0,0 +1,23 @@
|
|||
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
|
||||
|
||||
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}}"
|
6
_jobExamples/basic.conf
Normal file
6
_jobExamples/basic.conf
Normal file
|
@ -0,0 +1,6 @@
|
|||
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
|
7
_jobExamples/call_sql_procedure.conf
Normal file
7
_jobExamples/call_sql_procedure.conf
Normal file
|
@ -0,0 +1,7 @@
|
|||
Type = "sql" # sql execution
|
||||
Cron = "* * * * *" # cron instructions
|
||||
Description = "execute procedure every minute" # job description
|
||||
|
||||
Driver = "pgx" # "pgx" for Postgresql, "oracle" for Oracle, "sqlserver" for Microsoft SQL Server
|
||||
ConnectionString = "postgres://login:password@host:port/database?sslmode=disable" # each driver has different syntax
|
||||
SqlText = "CALL procedure" # command to execute
|
Loading…
Add table
Add a link
Reference in a new issue