-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added resticprofile flags --no-lock & --lock-wait (#33)
* Added resticprofile flags --no-lock & --lock-wait * Handle lock-wait and stale locks for restic "--lock-wait" also waits on non-stale restic remote locks Stale locks are unlocked when "force-inactive-locks" is true Uses global section to configure the behaviour (can also be disabled) * Allow to set lock-wait and no-lock within schedule
- Loading branch information
Showing
23 changed files
with
1,029 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,36 @@ | ||
package config | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/creativeprojects/resticprofile/constants" | ||
) | ||
|
||
// Global holds the configuration from the global section | ||
type Global struct { | ||
IONice bool `mapstructure:"ionice"` | ||
IONiceClass int `mapstructure:"ionice-class"` | ||
IONiceLevel int `mapstructure:"ionice-level"` | ||
Nice int `mapstructure:"nice"` | ||
Priority string `mapstructure:"priority"` | ||
DefaultCommand string `mapstructure:"default-command"` | ||
Initialize bool `mapstructure:"initialize"` | ||
ResticBinary string `mapstructure:"restic-binary"` | ||
MinMemory uint64 `mapstructure:"min-memory"` | ||
Scheduler string `mapstructure:"scheduler"` | ||
IONice bool `mapstructure:"ionice"` | ||
IONiceClass int `mapstructure:"ionice-class"` | ||
IONiceLevel int `mapstructure:"ionice-level"` | ||
Nice int `mapstructure:"nice"` | ||
Priority string `mapstructure:"priority"` | ||
DefaultCommand string `mapstructure:"default-command"` | ||
Initialize bool `mapstructure:"initialize"` | ||
ResticBinary string `mapstructure:"restic-binary"` | ||
ResticLockRetryAfter time.Duration `mapstructure:"restic-lock-retry-after"` | ||
ResticStaleLockAge time.Duration `mapstructure:"restic-stale-lock-age"` | ||
MinMemory uint64 `mapstructure:"min-memory"` | ||
Scheduler string `mapstructure:"scheduler"` | ||
} | ||
|
||
// newGlobal instantiates a new Global with default values | ||
func newGlobal() *Global { | ||
// NewGlobal instantiates a new Global with default values | ||
func NewGlobal() *Global { | ||
return &Global{ | ||
IONice: constants.DefaultIONiceFlag, | ||
Nice: constants.DefaultStandardNiceFlag, | ||
DefaultCommand: constants.DefaultCommand, | ||
ResticBinary: constants.DefaultResticBinary, | ||
MinMemory: constants.DefaultMinMemory, | ||
IONice: constants.DefaultIONiceFlag, | ||
Nice: constants.DefaultStandardNiceFlag, | ||
DefaultCommand: constants.DefaultCommand, | ||
ResticBinary: constants.DefaultResticBinary, | ||
ResticLockRetryAfter: constants.DefaultResticLockRetryAfter, | ||
ResticStaleLockAge: constants.DefaultResticStaleLockAge, | ||
MinMemory: constants.DefaultMinMemory, | ||
} | ||
} |
Oops, something went wrong.