#!/bin/bash
echo "###### Backup started: $(date) ######"
source "/etc/scripts/borg.env"
echo "Transfer files ..."
borg create -v --stats --progress \
    /mnt/HDD2/backups/hddbackup::'{now:%Y-%m-%d_%H:%M}'  \
    /mnt/HDD/         \

echo "Clearing old backups ..."
borg prune -v --list --keep-within=10d /mnt/HDD2/backups/hddbackup
borg compact /mnt/HDD2/backups/hddbackup

echo "###### Backup ended: $(date) ######"
