mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2026-04-02 20:05:23 +00:00
Merge remote-tracking branch 'origin/master' into 1.6.0
This commit is contained in:
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.5.8] - 2022-03-18
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Better error handling for bad config files.
|
||||||
|
|
||||||
## [1.5.7] - 2022-03-11
|
## [1.5.7] - 2022-03-11
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
Backends are the outputs of the backup process. Each location needs at least one.
|
Backends are the outputs of the backup process. Each location needs at least one.
|
||||||
|
|
||||||
|
Note: names of backends MUST be lower case!
|
||||||
|
|
||||||
```yaml | .autorestic.yml
|
```yaml | .autorestic.yml
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## `-c, --config`
|
## `-c, --config`
|
||||||
|
|
||||||
Specify the config file to be used.
|
Specify the config file to be used (must use .yml as an extension).
|
||||||
If omitted `autorestic` will search for for a `.autorestic.yml` in the current directory and your home directory.
|
If omitted `autorestic` will search for for a `.autorestic.yml` in the current directory and your home directory.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ This amazing people helped the project!
|
|||||||
- @david-boles - Docs.
|
- @david-boles - Docs.
|
||||||
- @SebDanielsson - Brew.
|
- @SebDanielsson - Brew.
|
||||||
- @n194 - AUR Package.
|
- @n194 - AUR Package.
|
||||||
|
- @olofvndrhr - Healthchecks example.
|
||||||
- @jin-park-dev - Typos.
|
- @jin-park-dev - Typos.
|
||||||
- @sumnerboy12 - Typos.
|
- @sumnerboy12 - Typos.
|
||||||
- @FuzzyMistborn - Typos.
|
- @FuzzyMistborn - Typos.
|
||||||
|
|||||||
@@ -14,4 +14,27 @@ This can come in handy if a backup process crashed or if it was accidentally can
|
|||||||
autorestic exec -b my-backend -- unlock
|
autorestic exec -b my-backend -- unlock
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Use hooks to integrate with [healthchecks](https://healthchecks.io/)
|
||||||
|
|
||||||
|
> Thanks to @olofvndrhr for providing it ❤️
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
extras:
|
||||||
|
healthchecks: &healthchecks
|
||||||
|
hooks:
|
||||||
|
before:
|
||||||
|
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Starting backup for location: ${AUTORESTIC_LOCATION}" https://<healthchecks-url>/ping/<uid>/start'
|
||||||
|
failure:
|
||||||
|
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Backup failed for location: ${AUTORESTIC_LOCATION}" https://<healthchecks-url>/ping/<uid>/fail'
|
||||||
|
success:
|
||||||
|
- 'curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Backup successful for location: ${AUTORESTIC_LOCATION}" https://<healthchecks-url>/ping/<uid>'
|
||||||
|
|
||||||
|
locations:
|
||||||
|
something:
|
||||||
|
<<: *healthchecks
|
||||||
|
from: /somewhere
|
||||||
|
to:
|
||||||
|
- somewhere-else
|
||||||
|
```
|
||||||
|
|
||||||
> :ToCPrevNext
|
> :ToCPrevNext
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
Locations can be seen as the input to the backup process. Generally this is simply a folder.
|
Locations can be seen as the input to the backup process. Generally this is simply a folder.
|
||||||
The paths can be relative from the config file. A location can have multiple backends, so that the data is secured across multiple servers.
|
The paths can be relative from the config file. A location can have multiple backends, so that the data is secured across multiple servers.
|
||||||
|
|
||||||
|
Note: names of locations MUST be lower case!
|
||||||
```yaml | .autorestic.yml
|
```yaml | .autorestic.yml
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
const VERSION = "1.5.7"
|
const VERSION = "1.5.8"
|
||||||
|
|
||||||
type OptionMap map[string][]interface{}
|
type OptionMap map[string][]interface{}
|
||||||
type Options map[string]OptionMap
|
type Options map[string]OptionMap
|
||||||
@@ -60,11 +60,16 @@ func GetConfig() *Config {
|
|||||||
colors.Faint.Println("Using env:\t", envFile)
|
colors.Faint.Println("Using env:\t", envFile)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cfgFileName := ".autorestic"
|
text := err.Error()
|
||||||
colors.Error.Println(
|
if strings.Contains(text, "no such file or directory") {
|
||||||
fmt.Sprintf(
|
cfgFileName := ".autorestic"
|
||||||
"cannot find configuration file '%s.yml' or '%s.yaml'.",
|
colors.Error.Println(
|
||||||
cfgFileName, cfgFileName))
|
fmt.Sprintf(
|
||||||
|
"cannot find configuration file '%s.yml' or '%s.yaml'.",
|
||||||
|
cfgFileName, cfgFileName))
|
||||||
|
} else {
|
||||||
|
colors.Error.Println("could not load config file\n" + text)
|
||||||
|
}
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user