added some features
- Added `cron` command to run lists with `cron` time specifed - Changed `-c` flag to `-f` flag for passing config file - Modified some config keys - cmdArgs -> Args - Got rid of `hosts.config` - better SSH handling - respects values in config file
This commit is contained in:
13
cmd/exec.go
13
cmd/exec.go
@ -1,3 +1,7 @@
|
||||
// exec.go
|
||||
// Copyright (C) Andrew Woodlee 2023
|
||||
// License: Apache-2.0
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
@ -9,7 +13,7 @@ import (
|
||||
|
||||
var (
|
||||
execCmd = &cobra.Command{
|
||||
Use: "exec command1 command2",
|
||||
Use: "exec command ...",
|
||||
Short: "Runs commands defined in config file.",
|
||||
Long: `Exec executes commands defined in config file.`,
|
||||
Run: execute,
|
||||
@ -23,9 +27,8 @@ func execute(cmd *cobra.Command, args []string) {
|
||||
}
|
||||
|
||||
opts := backy.NewOpts(cfgFile, backy.AddCommands(args))
|
||||
|
||||
commands := opts.GetCmdsInConfigFile()
|
||||
|
||||
commands.ExecuteCmds()
|
||||
opts.InitConfig()
|
||||
// opts.InitMongo()
|
||||
backy.ReadConfig(opts).ExecuteCmds()
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user