You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
504 B
25 lines
504 B
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.UseCron())
|
|
opts.InitConfig()
|
|
backy.ReadConfig(opts)
|
|
opts.Cron()
|
|
}
|