Disable monthly huge backups

Alright this was a bad idea
This commit is contained in:
Salt 2020-07-11 09:51:19 -05:00
parent d39ae2bc85
commit c68def849b

View File

@ -41,27 +41,27 @@ for dir in /home/*; do
[ -d "$dir/.backup" ] || continue
for file in "$dir/.backup/"*; do [ -e "$file" ] || continue; done
tar czhf "$OUTDIR/desktop-$username-{{ inventory_hostname }}-$(date -Iseconds).tar.gz" "$dir/.backup/"*
if (( "$(date +%d)" == "1" )) || [ -f "$forcefile" ]; then
log "Detected conditions for monthly dump"
if command -v aws > /dev/null 2>&1 && aws s3 ls "s3://$s3bucket" > /dev/null 2>&1; then
# Time for huge backups piped straight to S3
tar cz \
--exclude "$dir/.ansible" \
--exclude "$dir/.backup" \
--exclude "$dir/.cache" \
--exclude "$dir/.steam" \
--exclude "$dir/Downloads" \
--exclude "$dir/Dropbox" \
--exclude "$dir/Nextcloud" \
--exclude "$dir/snap" \
"$dir/."* \
| aws s3 cp - "s3://$s3bucket/{{ inventory_hostname }}/desktop-$username-{{ inventory_hostname }}-$(date -Iseconds)-full.tar.gz" \
--only-show-errors \
--storage-class STANDARD_IA
else
log "Could not satisfy requirements for AWS CLI"
fi
[ -f "$forcefile" ] && rm "$forcefile"
fi
# if (( "$(date +%d)" == "1" )) || [ -f "$forcefile" ]; then
# log "Detected conditions for monthly dump"
# if command -v aws > /dev/null 2>&1 && aws s3 ls "s3://$s3bucket" > /dev/null 2>&1; then
# # Time for huge backups piped straight to S3
# tar cz \
# --exclude "$dir/.ansible" \
# --exclude "$dir/.backup" \
# --exclude "$dir/.cache" \
# --exclude "$dir/.steam" \
# --exclude "$dir/Downloads" \
# --exclude "$dir/Dropbox" \
# --exclude "$dir/Nextcloud" \
# --exclude "$dir/snap" \
# "$dir/."* \
# | aws s3 cp - "s3://$s3bucket/{{ inventory_hostname }}/desktop-$username-{{ inventory_hostname }}-$(date -Iseconds)-full.tar.gz" \
# --only-show-errors \
# --storage-class STANDARD_IA
# else
# log "Could not satisfy requirements for AWS CLI"
# fi
# [ -f "$forcefile" ] && rm "$forcefile"
# fi
done