21 lines
369 B
Go
21 lines
369 B
Go
|
package cmd
|
||
|
|
||
|
import (
|
||
|
"code.jhot.me/jhot/docker-s3-backup/internal"
|
||
|
|
||
|
"github.com/spf13/cobra"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
rootCmd.AddCommand(scheduleCmd)
|
||
|
}
|
||
|
|
||
|
var scheduleCmd = &cobra.Command{
|
||
|
Use: "schedule",
|
||
|
Short: "Run the backup on a cron schedule",
|
||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||
|
err := internal.StartSchedule(cmd.Context())
|
||
|
return err
|
||
|
},
|
||
|
}
|