diff --git a/bin/backup-to-minio b/bin/backup-to-minio new file mode 100755 index 0000000..13fc3b4 --- /dev/null +++ b/bin/backup-to-minio @@ -0,0 +1,29 @@ +#!/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