#!/usr/bin/env bash # /etc/cron.weekly/backup-to-minio TEMP_DIR=$(mktemp -d || echo "Failed to make temp dir"; exit 1) chmod 700 "${TEMP_DIR}" trap 'rm -rf "${TEMP_DIR}" ; exit 0' 0 1 2 3 15 while read -r line; do rsync -aAX "$line" "${TEMP_DIR}" ; done