]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Attempt alternative method of snapshot cleanup.
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 9 Feb 2013 10:45:25 +0000 (03:45 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 9 Feb 2013 10:45:25 +0000 (03:45 -0700)
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.

mksnapshot-cron.sh

index bd79994219e37a8121f70ab1722ca80480cbf78a..7b6d28f51f94427a1f7fa8eeeb665ee17ec9b85b 100755 (executable)
@@ -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