19 lines
506 B
Bash
Executable file
19 lines
506 B
Bash
Executable file
#! /usr/bin/sh
|
|
|
|
TS_DIR="$(systemd-path user-state-private)"/backup
|
|
|
|
mkdir --parents "${TS_DIR}"
|
|
|
|
backup () {
|
|
target=$1
|
|
directory=$2
|
|
|
|
if "$(systemd-path user-binaries)"/dirtree-changed --directory "${directory}" --check-file "${TS_DIR}/${target}"
|
|
then
|
|
borg create --compression auto,lzma ::"${target}"-\{now\} "${directory}"
|
|
touch "${TS_DIR}/${target}"
|
|
fi
|
|
}
|
|
|
|
backup circuits "$(systemd-path user-configuration)"/circuits
|
|
backup documents "$(systemd-path user-documents)"
|