]> oss.titaniummirror.com Git - ovzbpc.git/blobdiff - bpcdump
bpcdump: simplify method for finding oldest backup on esata drive.
[ovzbpc.git] / bpcdump
diff --git a/bpcdump b/bpcdump
index 19644aca579300bc0a2be3df5cd4568fccbef14e..fff636ab3e0bc119075185a75faee3b1535d418a 100755 (executable)
--- a/bpcdump
+++ b/bpcdump
@@ -150,8 +150,7 @@ fi
 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 -ltd "ve${VEID}*" 2>/dev/null | tail -1 | \
-       awk '{ print $8 }')
+    oldest=$(cd $EXTFS && eval ls -td "ve${VEID}*" 2>/dev/null | tail -1)
     if [ -d "$EXTFS/$oldest" ]; then
        info "Removing old backup $oldest from $EXTFS"
        rm -rf "$EXTFS/$oldest"