2
0
Fork 0

zio-backup: remove tags

main
Ducky 2022-02-23 05:36:36 +00:00
parent ac1714cb4a
commit eec9f19f9d
1 changed files with 9 additions and 15 deletions

View File

@ -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