Files
bkpscripts/checkbackup.sh
Ivan Carlos de Almeida e4afa4d4e0
Some checks failed
Build, Push, Publish / Build & Release (push) Failing after 2s
first load
2025-12-16 04:38:42 -03:00

20 lines
572 B
Bash

#!/bin/bash
BUCKET_PATHS=(
"repo1:bucket1"
"repo1:bucket2"
"repo1:bucket3"
"repo2:bucket"
"repo3:bucket"
)
DAYS_THRESHOLD=2
MAILFROM="noreply+alert@icc.gg"
MAILTO="recipient@icc.gg"
for bucket in "${BUCKET_PATHS[@]}"; do
rclone_output=$(rclone lsl "$bucket" --max-age 2d)
if [ -z "$rclone_output" ]; then
aws ses send-email --from $MAILFROM --to $MAILTO --text "This $bucket looks outdated in $DAYS_THRESHOLD days or more." --html "<h1>Warning!</h1><p>This $bucket looks outdayed in $DAYS_THRESHOLD days or more.</p>" --subject "$bucket outdated!"
fi
done