Andrew
ee83586072
* 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.
25 lines
483 B
Go
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()
|
|
}
|