Linux hints: borg backup prune hint

borg backup prune hint

it’s very important to use “—prefix” with prune command with borgbackup, i had just done prunt without prefix and and up with loosing lot’s of data, it can be automated with something like this:


BACKUP_PATH="/path/to/backup/storage" #ssh path can be used here (remote machine)

export BORG_KEY_FILE="/path/to/key.file"
export BORG_PASSPHRASE="key_file_password"

for PREFIX in "${PREFIX_LIST[@]}"
    borg prune -v --list --keep-monthly=1 --keep-yearly=2 --keep-daily=3 --keep-weekly=4 --prefix=$PREFIX --save-space "${BACKUP_PATH}"