clean up borg backup notes

This commit is contained in:
2026-02-06 20:20:56 -05:00
parent fb19c81d47
commit 2b62ad0956
5 changed files with 80 additions and 127 deletions

View File

@@ -1,5 +1,7 @@
#!/bin/sh
set -x
{% for service in stop_services %}
systemctl stop {{ service }}
{% endfor %}
@@ -8,8 +10,12 @@ systemctl stop {{ service }}
systemctl --user --machine={{ systemd_user }}@.host stop {{ service }}
{% endfor %}
{% for compose in docker_compose_down %}
docker compose -f {{compose}} down
{% endfor %}
# Setting this, so the repo does not need to be given on the commandline:
export BORG_REPO={{ borg_user }}@{{ borg_host }}:{{ repo_name }}
export BORG_REPO={{ borg_user }}@{{ borg_host }}:.
# See the section "Passphrase notes" for more infos.
export BORG_PASSPHRASE={{ borg_passphrase }}
@@ -34,6 +40,7 @@ borg create \
--exclude 'home/*/.cache/*' \
--exclude 'var/tmp/*' \
--exclude 'home/*/.snapshots/*' \
--exclude 'home/.snapshots/*' \
{% for dir in exclude_dirs %}
--exclude '{{ dir }}' \
{% endfor %}
@@ -53,6 +60,10 @@ systemctl start {{ service }}
systemctl --user --machine={{ systemd_user }}@.host start {{ service }}
{% endfor %}
{% for compose in docker_compose_down %}
docker compose -f {{compose}} up -d
{% endfor %}
info "Pruning repository"
# Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly