#!/usr/bin/env bash # author: Daniel Sommer # license: MIT [[ "$EUID" != 0 ]] && printf "error: permission denied!\n" >&2 && exit 1 directories=( "/etc" ) printf ">> starting restic backup...\n" for directory in ${directories[@]}; do seconds="$SECONDS" printf "> backing up '"$directory"'...\n" restic backup --verbose --no-scan --retry-lock 3h "$directory" printf "> backup of '"$directory"' finished after "$(( $SECONDS - $seconds ))" seconds!\n" done printf ">> restic backup finished after "$SECONDS" seconds!\n"