Small Python-Script to find and delete identical borg archives.
export BORG_REPO=/where/us/my/repo
before you invoke the script- run
python3 borgRemoveIdenticalBackups.py
- script prints appropriate
borg delete ::<list-of-archive-names...>
- copy/paste this delete-command and execute on your needs
- Creates sorted file-list for every archive
Note: on first run this could take a while - Every file-entry is a text-line with lots of attributes for that file (size, mode, owner, times, etc.)
- Those file-lists are stored as gzipped text-files named
<archive-id>.orgArchiveIdx.gz
.
Feel free to quickly inspect them withzcat
orzless
Note: Script also deletes them up when appropriate archive is no more present in the borg-repo - A sha256-checksum is calculated for every
<archive-id>.orgArchiveIdx.gz
to find duplicates.
for every found duplicate, the newer one is proposed for deletion
That's it