backy/cmd/cron.go
Andrew ee83586072 Version 0.2.4
* Notifications now display errors and the output of the failed command.
* CI configs for GitHub and Woodpecker
* Added `version` subcommand
* Console logging can be disabled by setting `console-disabled` in the
`logging` object
* If Host was not defined for an incomplete `hosts` object, any commands
would fail as they could not look up the values in the SSH config files.
2023-02-18 22:42:15 -06:00

25 lines
483 B
Go

package cmd
import (
"git.andrewnw.xyz/CyberShell/backy/pkg/backy"
"github.com/spf13/cobra"
)
var (
cronCmd = &cobra.Command{
Use: "cron [flags]",
Short: "Runs command lists defined in config file.",
Long: `Cron starts a scheduler that executes command lists at the time defined in config file.`,
Run: cron,
}
)
func cron(cmd *cobra.Command, args []string) {
opts := backy.NewOpts(cfgFile, backy.UseCron())
opts.InitConfig()
backy.ReadConfig(opts).Cron()
}