Added code to delete all but the most recent 10 backups

This commit is contained in:
pezcurrel 2024-07-08 21:14:01 +02:00
parent af4a0e2aa5
commit 62a3163d5b

View file

@ -63,6 +63,8 @@ if [ "${ec}" != "0" ]; then
else
logcmd "xz -9 ${ofp}" "${logfp}"
fi
buff=`ls -1rt maintain/backups/${dbname}_backup-*.sql.xz | head -n -10`
for fn in $buff; do rm "$fn"; done
[ $ok -eq 1 ] && subj="maintain.bash: tutto ok :-)" || subj="maintain.bash: ci sono errori :-("
body="[[[ ${logfp} ]]]\n\n"
body+=`cat "${logfp}"`