From 8ffe19dfd1bf3cb1d079b812a3cada9cc7844893 Mon Sep 17 00:00:00 2001 From: Jeffrey Serio Date: Wed, 22 Jan 2025 21:58:44 -0600 Subject: [PATCH] Add backup_docker_volumes --- {shell => .archived/shell}/check_repl_status | 0 shell/backup_docker_volumes | 29 ++++++++++++++++++++ shell/quick-backup | 6 ---- shell/sync_to_protondrive | 7 ----- 4 files changed, 29 insertions(+), 13 deletions(-) rename {shell => .archived/shell}/check_repl_status (100%) create mode 100755 shell/backup_docker_volumes delete mode 100755 shell/quick-backup delete mode 100755 shell/sync_to_protondrive diff --git a/shell/check_repl_status b/.archived/shell/check_repl_status similarity index 100% rename from shell/check_repl_status rename to .archived/shell/check_repl_status diff --git a/shell/backup_docker_volumes b/shell/backup_docker_volumes new file mode 100755 index 0000000..29b3915 --- /dev/null +++ b/shell/backup_docker_volumes @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if ! test -f /usr/local/bin/vackup; then + echo "You need the vackup script from https://github.com/BretFisher/docker-vackup" + exit 1 +fi + +BACKUP_DIR="${HOME}/docker_volume_backups" +DATE=$(date '+%Y-%m-%d_%H%M%S') +KEEP=7 + +volumes=( + "freshrss_data" + "freshrss_db" + "freshrss_extensions" + "qbittorrent-docker_qbittorrent-config" + "shaarli_shaarli-cache" + "shaarli_shaarli-data" +) + +for vol in "${volumes[@]}"; do + /usr/local/bin/vackup export "$vol" "${BACKUP_DIR}/${vol}-${DATE}.tar.gz" +done + +find "$BACKUP_DIR" -maxdepth 1 -mtime +"$KEEP" -type f -delete + +exit 0 diff --git a/shell/quick-backup b/shell/quick-backup deleted file mode 100755 index 18b037f..0000000 --- a/shell/quick-backup +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -if ! kbackup --verbose --autobg /home/jas/ownCloud/documents/quickbackup.kbp; then - echo "Error running kbackup" - exit 1 -fi diff --git a/shell/sync_to_protondrive b/shell/sync_to_protondrive deleted file mode 100755 index 0215d3a..0000000 --- a/shell/sync_to_protondrive +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -rclone sync --transfers 8 -P -u -c --ignore-existing /home/jas/ownCloud/ protondrive:/ - -exit 0