From: Amos Jeffries Date: Sat, 9 Feb 2013 10:45:25 +0000 (-0700) Subject: Attempt alternative method of snapshot cleanup. X-Git-Tag: SQUID_3_4_0_1~294 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=5f3f8b3f2365a48d019b1c8d6943ba11accb4cf0;p=thirdparty%2Fsquid.git Attempt alternative method of snapshot cleanup. Something in the sed regex patterns is not matching the snapshots detected by the ls pattern. We can skip the sed and use the full file path ls found to remove the snapshot. --- diff --git a/mksnapshot-cron.sh b/mksnapshot-cron.sh index bd79994219..7b6d28f51f 100755 --- a/mksnapshot-cron.sh +++ b/mksnapshot-cron.sh @@ -61,12 +61,11 @@ make_snapshot() set +e # cleanup old snapshots ls ${dst}/*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r*[0-9]${type} | \ - sed -e 's/.*-\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r[0-9]+'${type}'\)/\1/' | \ +# sed -e 's/.*-\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-r[0-9]+'${type}'\)/\1/' | \ sort -r | tail +${save} | \ while read f; do - rm -f ${dst}/*-${f} ${dst}/*-${f}.md5 + rm -f ${f} ${f}.md5 done - set -e # update dynamic index pages Last-Modified info