Skip to content

Commit

Permalink
Restic 0.17 (#396)
Browse files Browse the repository at this point in the history
* add support for restic 0.17

* update config for local tests
  • Loading branch information
creativeprojects authored Aug 16, 2024
1 parent 80a757d commit 1e80d02
Show file tree
Hide file tree
Showing 4 changed files with 377 additions and 38 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ generate-restic:
$(RESTIC_GEN) --install $(RESTIC_DIR)0.14.0 --version=0.14.0 --commands $(RESTIC_CMD)
$(RESTIC_GEN) --install $(RESTIC_DIR)0.15.0 --version=0.15.0 --commands $(RESTIC_CMD)
$(RESTIC_GEN) --install $(RESTIC_DIR)0.16.0 --version=0.16.0 --commands $(RESTIC_CMD)
$(RESTIC_GEN) --install $(RESTIC_DIR)0.16.1 --version=0.16.1 --commands $(RESTIC_CMD)
$(RESTIC_GEN) --install $(RESTIC_DIR)0.16.4 --version=0.16.4 --commands $(RESTIC_CMD)
$(RESTIC_GEN) --install $(RESTIC_DIR)0.17.0 --version=0.17.0 --commands $(RESTIC_CMD)

cp $(RESTIC_CMD) restic/commands.json

Expand Down
6 changes: 6 additions & 0 deletions examples/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ self:
schedule-log: "_schedule-log.txt"
schedule-ignore-on-battery: true
schedule-after-network-online: true
skip-if-unchanged: true

run-before:
- "echo DOW=`date +\"%u\"` >> {{ env }}"
Expand Down Expand Up @@ -339,3 +340,8 @@ empty-fields:
keep-tag: ""
group-by: ""
tag: ""

nopwd:
initialize: true
repository: "/Volumes/RAMDisk/{{ .Profile.Name }}"
insecure-no-password: true
2 changes: 2 additions & 0 deletions restic/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ var (
manSectionStart = regexp.MustCompile(`^\.SH ([A-Z 0-9]+)$`)
manParagraphStart = regexp.MustCompile(`^\.PP$`)
manEscapeSequence = regexp.MustCompile(`(\\f[A-Z]|\\)`)
lineCleanup = regexp.MustCompile("([`]{2,})")
)

func parseStream(input io.Reader, commandName string) (cmd *command, err error) {
Expand Down Expand Up @@ -182,6 +183,7 @@ func parseStream(input io.Reader, commandName string) (cmd *command, err error)
}
} else {
line = manEscapeSequence.ReplaceAllString(line, "")
line = lineCleanup.ReplaceAllString(line, "")

switch section {
case "DESCRIPTION":
Expand Down
Loading

0 comments on commit 1e80d02

Please sign in to comment.