Add backup_docker_volumes

This commit is contained in:
Jeffrey Serio 2025-01-22 21:58:44 -06:00
parent f52222fb47
commit 8ffe19dfd1
4 changed files with 29 additions and 13 deletions

29
shell/backup_docker_volumes Executable file
View File

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

View File

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

View File

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