Created
          December 4, 2021 14:34 
        
      - 
      
- 
        Save mkaraki/d15b5cac05a792e983740df1f881a30f to your computer and use it in GitHub Desktop. 
    Backup script for maas kvm (virt)
  
        
  
    
      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
    
  
  
    
  | #!/bin/bash | |
| destdir=/mnt/backupstorage | |
| date=$(date +"%Y%m%d") | |
| for f in /var/lib/libvirt/maas-images/* ;do | |
| fn=$(basename -- $f) | |
| dest="$destdir/$date-$fn.qcow2" | |
| echo "$f => $dest" | |
| qemu-img convert -c -f raw -O qcow2 $f $dest | |
| done | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment