------------------------------------------------------------ revno: 11855 revision-id: squid3@treenet.co.nz-20111109022314-cumehx5d4fzqch48 parent: squidadm@squid-cache.org-20111109013519-9mjx15rmyjnxbcs2 committer: Amos Jeffries branch nick: trunk timestamp: Tue 2011-11-08 19:23:14 -0700 message: Maintenance: keep 30 snapshots and detect the new file pattern for removals ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20111109022314-cumehx5d4fzqch48 # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 77926da3f600c274b6fa31bcef2230fa9f9f510c # timestamp: 2011-11-09 02:55:38 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squidadm@squid-cache.org-20111109013519-\ # 9mjx15rmyjnxbcs2 # # Begin patch === modified file 'mksnapshot-cron.sh' --- mksnapshot-cron.sh 2011-09-15 14:07:43 +0000 +++ mksnapshot-cron.sh 2011-11-09 02:23:14 +0000 @@ -59,7 +59,10 @@ ln -s ${file}.md5 ${dst}/squid-${ver}.snapshot${type}.md5 # cleanup old snapshots - 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 + 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/' | \ + sort -r | tail +${save} | \ + while read f; do rm -f ${dst}/*-${f} ${dst}/*-${f}.md5 done @@ -102,10 +105,10 @@ mv -f /server/httpd/htdocs/squid-cache.org/SPONSORS.new /server/httpd/htdocs/squid-cache.org/content/SPONSORS.txt ../commit/bootstrap squid-3.2 -make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_2 v3 3.2 5 +make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_2 v3 3.2 30 ../commit/bootstrap squid-3.1 -make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_1 v3 3.1 3 +make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_1 v3 3.1 30 #../commit/bootstrap squid-3.0 #make_snapshot ../commit/squid-3/mksnapshot.sh branches/SQUID_3_0 v3 3.0 3