Skip to content

Commit

Permalink
fix: remove schedule name from arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
creativeprojects committed Nov 14, 2023
1 parent ffee984 commit 24a6d6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,8 @@ func getRemovableScheduleJobs(c *config.Config, flags commandLineFlags) (schedul
}

func preRunSchedule(ctx *Context) error {
if len(ctx.request.arguments) != 1 {
return errors.New("run-schedule command expects one argument (only): schedule name")
if len(ctx.request.arguments) < 1 {
return errors.New("run-schedule command expects one argument: schedule name")
}
scheduleName := ctx.request.arguments[0]
if ctx.config.GetVersion() < config.Version02 {
Expand All @@ -598,6 +598,8 @@ func preRunSchedule(ctx *Context) error {
ctx.request.profile = profileName
ctx.request.schedule = scheduleName
ctx.command = commandName
// remove the parameter from the arguments
ctx.request.arguments = ctx.request.arguments[1:]

// don't save the profile in the context now, it's only loaded but not prepared
profile, err := ctx.config.GetProfile(profileName)
Expand Down
2 changes: 1 addition & 1 deletion examples/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ global:
# legacy-arguments: true
group-continue-on-error: true
restic-lock-retry-after: "1m"
log: "_global.txt"
# log: "_global.txt"

groups:
full-backup:
Expand Down

0 comments on commit 24a6d6d

Please sign in to comment.