#!/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