Updated backup with better logging

This commit is contained in:
keystroke 2026-05-04 02:34:48 +10:00
parent 5721602c59
commit 43334ca69b

View file

@ -1,12 +1,18 @@
#!/bin/bash
if [ $# -eq 0 ]; then
>&2 echo 'No backup file provided'
exit 1
>&2 echo 'No backup file provided'
exit 1
fi
grep -ve '^$\|^#' "$1" | \
while read location; do
echo "Backing up $location"
rclone sync "$location" mega:backup-"$(hostname)${location%/*}" -vlM --create-empty-src-dirs --exclude '**cache**' --ignore-case
done
rclone sync "$location" mega:backup-"$(hostname)${location%/*}" \
-v --stats-one-line --stats 0 \
--links \
--metadata \
--create-empty-src-dirs \
--exclude '**cache**' \
--ignore-case
done