Created
          August 29, 2021 10:46 
        
      - 
      
 - 
        
Save phiresky/f362d1bb52ed679b43a117726d7f05b2 to your computer and use it in GitHub Desktop.  
    recursively convert a rdiff-backup repository to a borg backup one
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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