30 lines
778 B
Bash
Executable file
30 lines
778 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# author: Daniel Sommer <daniel.sommer@velvettear.de>
|
|
# license: MIT
|
|
|
|
[[ "$EUID" != 0 ]] && printf "error: permission denied!\n" >&2 && exit 1
|
|
|
|
directories=(
|
|
"/etc"
|
|
"/mnt/storage/audiobooks"
|
|
"/mnt/storage/comics"
|
|
"/mnt/storage/documents"
|
|
"/mnt/storage/ebooks"
|
|
"/mnt/storage/images"
|
|
"/mnt/storage/music"
|
|
"/mnt/storage/software"
|
|
"/mnt/storage/syncthing"
|
|
"/mnt/storage/videos"
|
|
)
|
|
|
|
printf ">> starting restic backup...\n"
|
|
|
|
for directory in ${directories[@]}; do
|
|
seconds="$SECONDS"
|
|
printf "\n> 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"
|