#保留站点最近部署的5个版本目录,目录规则为xxxx-xxx-xxx-2.0.10forverin"xxx-xxx-xxx""bbb-bbb-bbb"doversionList=$(ls/root/dnmp/wwwgrep"${ver}-[0-9]"sort-t'-'-k3,3-Vr)i=0vars={}forversionin$versionListdo#vars=${version##*-}i=$i+1if[[${i}-gt3]];then#dockerstop$version#dockerrm$version#rm-rf/root/dnmp/www/${version}echo"dele