From: hno <> Date: Thu, 29 Sep 2005 04:07:30 +0000 (+0000) Subject: Fix cleanup of old snapshots when there has been release candidates X-Git-Tag: SQUID_3_0_PRE4~592 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b880197761f5688ba9d379dfd83503e994fe12e3;p=thirdparty%2Fsquid.git Fix cleanup of old snapshots when there has been release candidates --- diff --git a/mksnapshot-cron.sh b/mksnapshot-cron.sh index 00abe20fa2..d8d6c8bba3 100755 --- a/mksnapshot-cron.sh +++ b/mksnapshot-cron.sh @@ -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