specific location

This commit is contained in:
2021-10-28 17:29:32 +02:00
parent ddc3accb30
commit 83905d2993
3 changed files with 33 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ package cmd
import (
"fmt"
"strings"
"github.com/cupcakearmy/autorestic/internal"
"github.com/cupcakearmy/autorestic/internal/colors"
@@ -22,8 +23,13 @@ var backupCmd = &cobra.Command{
CheckErr(err)
errors := 0
for _, name := range selected {
location, _ := internal.GetLocation(name)
errs := location.Backup(false)
var splitted = strings.Split(name, "@")
var specificBackend = ""
if len(splitted) > 1 {
specificBackend = splitted[1]
}
location, _ := internal.GetLocation(splitted[0])
errs := location.Backup(false, specificBackend)
for err := range errs {
colors.Error.Println(err)
errors++