← Back to team overview

openstack team mailing list archive

Node Disk Cleaning Script

 

Hi!
I hope this script will usefull for somebody.

#!/bin/bash
cd /var/lib/nova/instances
find -name "disk*" | xargs -n1 qemu-img info | grep backing | sed
-e's/.*file: //' -e 's/ .*//' | sort | uniq > /tmp/ignore
while read i; do
ARGS="$ARGS  \( ! -path $i  \) "
done < /tmp/ignore
find /var/lib/nova/instances/_base/ -type f  $ARGS  -delete

Follow ups