backy/cmd/cron.go
Andrew Woodlee 5c2bfcc940
Some checks failed
ci/woodpecker/push/go-lint Pipeline failed
[WIP] v0.7.0
2025-01-14 09:42:43 -06:00

26 lines
504 B
Go

package cmd
import (
"git.andrewnw.xyz/CyberShell/backy/pkg/backy"
"github.com/spf13/cobra"
)
var (
cronCmd = &cobra.Command{
Use: "cron [flags]",
Short: "Starts a scheduler that runs 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.CronEnabled())
opts.InitConfig()
opts.ReadConfig()
opts.Cron()
}