backy/cmd/cron.go

27 lines
578 B
Go
Raw Normal View History

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) {
2025-02-08 15:17:34 -06:00
parseS3Config()
2025-02-20 14:53:44 -06:00
opts := backy.NewOpts(cfgFile, backy.EnableCron(), backy.SetLogFile(logFile), backy.SetCmdStdOut(cmdStdOut))
opts.InitConfig()
2025-01-14 09:42:43 -06:00
opts.ReadConfig()
opts.Cron()
}