Skip to content

Commit

Permalink
[K10-1255] Add restic-forget commands (#5257)
Browse files Browse the repository at this point in the history
* Add restic-forget commands

* Address review comments
  • Loading branch information
DeepikaDixit authored and Ilya Kislenko committed Mar 22, 2019
1 parent 1d5e586 commit e68377e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pkg/restic/restic.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,18 @@ func InitCommand(profile *param.Profile, repository, encryptionKey string) []str
return shCommand(command)
}

// ForgetCommand returns restic forget command
func ForgetCommand(profile *param.Profile, repository, encryptionKey string) []string {
// ForgetCommandByTag returns restic forget command
func ForgetCommandByTag(profile *param.Profile, repository, tag, encryptionKey string) []string {
cmd := resticArgs(profile, repository, encryptionKey)
cmd = append(cmd, "forget")
cmd = append(cmd, "forget", "--tag", tag, "--prune")
command := strings.Join(cmd, " ")
return shCommand(command)
}

// ForgetCommandByID returns restic forget command
func ForgetCommandByID(profile *param.Profile, repository, id, encryptionKey string) []string {
cmd := resticArgs(profile, repository, encryptionKey)
cmd = append(cmd, "forget", id, "--prune")
command := strings.Join(cmd, " ")
return shCommand(command)
}
Expand Down

0 comments on commit e68377e

Please sign in to comment.