This commit is contained in:
parent
16acf9db91
commit
0615a7e353
|
|
@ -21,6 +21,9 @@ actions:
|
|||
shellAfterCompleted: "apprise -t 'Notification: Backup script completed' -b 'The backup script completed with code {{ exitCode}}. The log is: \n {{ stdout }} '"
|
||||
maxConcurrent: 1
|
||||
icon: backup
|
||||
execOnCron: # https://docs.olivetin.app/exec-cron.html
|
||||
- "@monthly" # Once per month
|
||||
- "0 12 25 12 *" # And on Christmas day!
|
||||
|
||||
# This will send 1 ping (-c 1)
|
||||
# Docs: https://docs.olivetin.app/action-ping.html
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ type Config struct {
|
|||
DefaultPermissions PermissionsList
|
||||
AccessControlLists []AccessControlList
|
||||
WebUIDir string
|
||||
CronSupportForSeconds bool
|
||||
}
|
||||
|
||||
// DefaultConfig gets a new Config structure with sensible default values.
|
||||
|
|
@ -110,6 +111,7 @@ func DefaultConfig() *Config {
|
|||
config.AuthJwtClaimUsername = "name"
|
||||
config.AuthJwtClaimUserGroup = "group"
|
||||
config.WebUIDir = "./webui"
|
||||
config.CronSupportForSeconds = false
|
||||
|
||||
return &config
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,13 @@ import (
|
|||
)
|
||||
|
||||
func Schedule(cfg *config.Config, ex *executor.Executor) {
|
||||
scheduler := cron.New(cron.WithSeconds())
|
||||
var scheduler *cron.Cron
|
||||
|
||||
if cfg.CronSupportForSeconds {
|
||||
scheduler = cron.New(cron.WithSeconds())
|
||||
} else {
|
||||
scheduler = cron.New()
|
||||
}
|
||||
|
||||
for _, action := range cfg.Actions {
|
||||
for _, cronline := range action.ExecOnCron {
|
||||
|
|
|
|||
Loading…
Reference in New Issue