mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 16:26:25 +00:00
Compare commits
2 Commits
19eae96ef2
...
7d156ce8f1
Author | SHA1 | Date | |
---|---|---|---|
|
7d156ce8f1 | ||
|
a5af001521 |
@ -19,14 +19,15 @@ type BackendRest struct {
|
||||
}
|
||||
|
||||
type Backend struct {
|
||||
name string
|
||||
Type string `mapstructure:"type,omitempty"`
|
||||
Path string `mapstructure:"path,omitempty"`
|
||||
Key string `mapstructure:"key,omitempty"`
|
||||
RequireKey bool `mapstructure:"requireKey,omitempty"`
|
||||
Env map[string]string `mapstructure:"env,omitempty"`
|
||||
Rest BackendRest `mapstructure:"rest,omitempty"`
|
||||
Options Options `mapstructure:"options,omitempty"`
|
||||
name string
|
||||
Type string `mapstructure:"type,omitempty"`
|
||||
Path string `mapstructure:"path,omitempty"`
|
||||
Key string `mapstructure:"key,omitempty"`
|
||||
RequireKey bool `mapstructure:"requireKey,omitempty"`
|
||||
AllowFailure bool `mapstructure:"allowFailure,omitempty"`
|
||||
Env map[string]string `mapstructure:"env,omitempty"`
|
||||
Rest BackendRest `mapstructure:"rest,omitempty"`
|
||||
Options Options `mapstructure:"options,omitempty"`
|
||||
}
|
||||
|
||||
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 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)
|
||||
errors = append(errors, fmt.Errorf("%s@%s:\n%s%s", l.name, backend.name, out, err))
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user