mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 08:16:25 +00:00
parent
f7d28b486c
commit
a33b782c54
@ -19,14 +19,15 @@ type BackendRest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Backend struct {
|
type Backend struct {
|
||||||
name string
|
name string
|
||||||
Type string `mapstructure:"type,omitempty" yaml:"type,omitempty"`
|
Type string `mapstructure:"type,omitempty" yaml:"type,omitempty"`
|
||||||
Path string `mapstructure:"path,omitempty" yaml:"path,omitempty"`
|
Path string `mapstructure:"path,omitempty" yaml:"path,omitempty"`
|
||||||
Key string `mapstructure:"key,omitempty" yaml:"key,omitempty"`
|
Key string `mapstructure:"key,omitempty" yaml:"key,omitempty"`
|
||||||
RequireKey bool `mapstructure:"requireKey,omitempty" yaml:"requireKey,omitempty"`
|
RequireKey bool `mapstructure:"requireKey,omitempty" yaml:"requireKey,omitempty"`
|
||||||
Env map[string]string `mapstructure:"env,omitempty" yaml:"env,omitempty"`
|
AllowFailure bool `mapstructure:"allowFailure,omitempty" yaml:"allowFailure,omitempty"`
|
||||||
Rest BackendRest `mapstructure:"rest,omitempty" yaml:"rest,omitempty"`
|
Env map[string]string `mapstructure:"env,omitempty" yaml:"env,omitempty"`
|
||||||
Options Options `mapstructure:"options,omitempty" yaml:"options,omitempty"`
|
Rest BackendRest `mapstructure:"rest,omitempty" yaml:"rest,omitempty"`
|
||||||
|
Options Options `mapstructure:"options,omitempty" yaml:"options,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetBackend(name string) (Backend, bool) {
|
func GetBackend(name string) (Backend, bool) {
|
||||||
|
@ -267,6 +267,13 @@ func (l Location) Backup(cron bool, specificBackend string) []error {
|
|||||||
|
|
||||||
// If error save it and continue
|
// If error save it and continue
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if backend.AllowFailure {
|
||||||
|
colors.Faint.Printf("skipping backend \"%s\" since allowFailure was set to \"true\"\n", to)
|
||||||
|
if flags.VERBOSE {
|
||||||
|
colors.Error.Printf("reason: %s", out)
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
colors.Error.Println(out)
|
colors.Error.Println(out)
|
||||||
errors = append(errors, fmt.Errorf("%s@%s:\n%s%s", l.name, backend.name, out, err))
|
errors = append(errors, fmt.Errorf("%s@%s:\n%s%s", l.name, backend.name, out, err))
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user