diff --git a/usr/local/sbin/zio-backup b/usr/local/sbin/zio-backup index 81671a1..05067e7 100755 --- a/usr/local/sbin/zio-backup +++ b/usr/local/sbin/zio-backup @@ -23,14 +23,11 @@ function restic_exec() { function backup() { path="$1" - tag="$2" - args="${@:3}" + args="${@:2}" if [[ ! -d $path ]]; then warn "'$path' does not exist. Not backing up." else - tag="$host_$tag" - restic_exec \ backup \ --iexclude "__MACOSX" \ @@ -48,21 +45,18 @@ function backup() { --iexclude "tmp" \ --exclude-if-present ".nobackup" \ --host "$host" \ - --tag "$tag" \ $args "$path" fi } function forget() { - tag="$1" - - tag="$host_$tag" + path="$1" restic_exec \ forget \ --host "$host" \ --keep-last 5 \ - --tag "$tag" + --path "$tag" } function get_prop() { @@ -137,9 +131,9 @@ do done say_do "Backing up files..." -backup /etc config -backup /srv/store store -backup /var variable +backup /etc +backup /srv/store +backup /var if [[ ! -z $post_script ]]; then say_do "Executing post-backup script..." @@ -147,6 +141,6 @@ if [[ ! -z $post_script ]]; then fi say_do "Removing old backups..." -forget config -forget store -forget variable +forget /etc +forget /srv/store +forget /var