]> oss.titaniummirror.com Git - ovzbpc.git/blobdiff - bpcdump
bpcdump: allow removal of any VE backup
[ovzbpc.git] / bpcdump
diff --git a/bpcdump b/bpcdump
index 2db202c32e8ef1991a9e79b26af440223981850e..90ecd0291c7dd2de53f3544e5b37edadae3172da 100755 (executable)
--- a/bpcdump
+++ b/bpcdump
@@ -147,11 +147,12 @@ else
 fi
 
 # Before we begin writing, remove old backup dirs until we have room.
+# Assume backups for any VE are fair game for removal if space is needed.
 # Other disk contents shall not be removed.
 dstblks=$(df -P "$EXTFS" | grep "$EXTFS" | awk '{ print $4 }')
 while [ $dstblks -le $srcblks ]; do
     info "Only $dstblks free on $EXTFS"
-    oldest=$(cd $EXTFS && eval ls -td "ve${VEID}*" 2>/dev/null | tail -1)
+    oldest=$(cd $EXTFS && eval ls -td "ve[0-9]*" 2>/dev/null | tail -1)
     if [ -z "$oldest" ]; then
       cleanup 1 "out of space: need $srcblks KB, have $dstblks KB"
     elif [ -d "$EXTFS/$oldest" ]; then