From 5d9c0c9315dcf6ad6ffa2d1227c8cbbfcc690f76 Mon Sep 17 00:00:00 2001 From: Francesco Ciocchetti Date: Mon, 28 Oct 2019 09:48:09 +0100 Subject: [PATCH] Add support for multiple, comma separated , tags --- restic-runner | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/restic-runner b/restic-runner index 98f6ef0..a0e5fd6 100755 --- a/restic-runner +++ b/restic-runner @@ -13,7 +13,7 @@ # Backup set config files should specify these variables: -# tag: Tag string for backup set. +# tag: Tag string for backup set. Comma separated list # include_paths: An array of strings, each of which is a path to backup. # exclude_patterns: An array of strings, each of which is an exclude glob pattern. # keep_policy: An array of "--keep-period N" strings (unquoted in the array) @@ -159,7 +159,7 @@ function tag { if [[ $tag ]] then - echo "--tag $tag" + echo "--tag $(echo $tag | sed -e 's/,/ --tag /g')" fi } @@ -170,7 +170,7 @@ function snapshot-ids { unset du restic snapshots \ - --tag "$tag" \ + $(tag) \ | head -n -2 \ | tail -n +3 \ | awk '/^[^ ]/ { print $1 }' @@ -276,7 +276,7 @@ function backup { --exclude-caches \ $(exclude_if_present) \ --exclude-file "$exclude_file" \ - --tag "$tag" \ + $(tag) \ "${include_paths[@]}" } function check {