Skip to content

Instantly share code, notes, and snippets.

@phiresky
Created August 29, 2021 10:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phiresky/f362d1bb52ed679b43a117726d7f05b2 to your computer and use it in GitHub Desktop.
Save phiresky/f362d1bb52ed679b43a117726d7f05b2 to your computer and use it in GitHub Desktop.
recursively convert a rdiff-backup repository to a borg backup one
set -e
set -x
src=backup
dst=borg
tmpdir=./tmp
t1=$(mktemp)
rdiff-backup --list-increments $src > $t1
tac $t1 | rg '^ ' | rg 'increments\.(.*)\.dir.*' -r '$1' | while read date; do
echo doing $date
touch $src/rdiff-backup-data/current_mirror.$date.data
rdiff-backup -v6 --check-destination-dir --tempdir $tmpdir $src
borg create "borg::db $date" "$src" --stats --chunker-params=9,20,14,4095 --compression zstd,8 --exclude "$src/rdiff-backup-data" --timestamp "$src/backup.log" --progress
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment