]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix cleanup of old snapshots when there has been release candidates
authorhno <>
Thu, 29 Sep 2005 04:07:30 +0000 (04:07 +0000)
committerhno <>
Thu, 29 Sep 2005 04:07:30 +0000 (04:07 +0000)
mksnapshot-cron.sh

index 00abe20fa2e59f8591fd159b72dc8ad2866235f9..d8d6c8bba39d7f63cdb2926eee57068f1188bda8 100755 (executable)
@@ -42,7 +42,9 @@ make_snapshot()
     ln -s $file $dst/squid-$ver.snapshot$type
 
     # cleanup old snapshots
-    ls $dst/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$type | sort -r -t- +2 | tail +$save | xargs rm -f
+    ls $dst/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$type | sed -e 's/.*\(-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'$type'\)/\1/' | sort -r | tail +$save | while read f; do
+       rm -f *-$f
+    done
   done
 
   # update web page