From f2dfde23f8157da1532a2b2e236af529fed47713 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Thu, 11 Apr 2024 16:21:15 -0500 Subject: replace janky deploy script with stow and make re-orgs all the console oriented dotfiles to be stowable makefile to deploy everything move from vimplug to native vim packages cleanup script for blowing away old symlinks --- stow/duplicity/.local/bin/backup | 27 ++++++++++++++++++++++ .../.local/share/systemd/user/backup.service | 7 ++++++ .../.local/share/systemd/user/backup.timer | 9 ++++++++ 3 files changed, 43 insertions(+) create mode 100755 stow/duplicity/.local/bin/backup create mode 100644 stow/duplicity/.local/share/systemd/user/backup.service create mode 100644 stow/duplicity/.local/share/systemd/user/backup.timer (limited to 'stow/duplicity') diff --git a/stow/duplicity/.local/bin/backup b/stow/duplicity/.local/bin/backup new file mode 100755 index 0000000..6324c05 --- /dev/null +++ b/stow/duplicity/.local/bin/backup @@ -0,0 +1,27 @@ +#!/bin/bash + +set -euo pipefail + +set -o allexport +# shellcheck source=../../.config/duplicity/config +source ~/.config/duplicity/config +set +o allexport + +source_directory=~ +excludes=~/.config/duplicity/excludes +target_url=b2://"$B2_KEY_ID"@"$B2_BUCKET" + +# take a new full backup every month, incremental otherwise +duplicity backup --full-if-older-than 1M --exclude-filelist "$excludes" "$source_directory" "$target_url" + +# keep 12 months of full backups +duplicity remove-all-but-n-full 12 --force "$target_url" + +# keep 3 months of incremental backups +duplicity remove-all-inc-of-but-n-full 3 --force "$target_url" + +# cleanup +duplicity cleanup --force "$target_url" + +# show collection status +duplicity collection-status "$target_url" diff --git a/stow/duplicity/.local/share/systemd/user/backup.service b/stow/duplicity/.local/share/systemd/user/backup.service new file mode 100644 index 0000000..c1adfde --- /dev/null +++ b/stow/duplicity/.local/share/systemd/user/backup.service @@ -0,0 +1,7 @@ +[Unit] +Description=Backup with duplicity +After=network.target + +[Service] +Type=oneshot +ExecStart=bash ${HOME}/.local/bin/backup diff --git a/stow/duplicity/.local/share/systemd/user/backup.timer b/stow/duplicity/.local/share/systemd/user/backup.timer new file mode 100644 index 0000000..b7815d6 --- /dev/null +++ b/stow/duplicity/.local/share/systemd/user/backup.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run backup every four hours + +[Timer] +OnCalendar=*-*-* 0/4:15 +Persistent=true + +[Install] +WantedBy=timers.target -- cgit v1.2.3