mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 08:16:25 +00:00
use built in function
This commit is contained in:
parent
efd4a7dfea
commit
6be0a80b29
@ -157,16 +157,13 @@ func (l Location) Backup(cron bool, specificBackend string) []error {
|
|||||||
if specificBackend == "" {
|
if specificBackend == "" {
|
||||||
backends = l.To
|
backends = l.To
|
||||||
} else {
|
} else {
|
||||||
for _, b := range l.To {
|
if l.hasBackend(specificBackend) {
|
||||||
if b == specificBackend {
|
backends = []string{specificBackend}
|
||||||
backends = []string{b}
|
} else {
|
||||||
goto backup
|
errors = append(errors, fmt.Errorf("backup location \"%s\" has no backend \"%s\"", l.name, specificBackend))
|
||||||
}
|
return errors
|
||||||
}
|
}
|
||||||
errors = append(errors, fmt.Errorf("backup location \"%s\" has no backend \"%s\"", l.name, specificBackend))
|
|
||||||
return errors
|
|
||||||
}
|
}
|
||||||
backup:
|
|
||||||
for i, to := range backends {
|
for i, to := range backends {
|
||||||
backend, _ := GetBackend(to)
|
backend, _ := GetBackend(to)
|
||||||
colors.Secondary.Printf("Backend: %s\n", backend.name)
|
colors.Secondary.Printf("Backend: %s\n", backend.name)
|
||||||
|
Loading…
Reference in New Issue
Block a user