File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ if [ ${leave_mounted} -eq 0 ]; then
222222 fi
223223
224224 # invoke logrotate to rotate over old pool db backups
225- echo -n " Rotating old backups: "
225+ echo -n " Rotating old DB backups: "
226226 logrotate -f " ${lrconf} "
227227 num_found=$( find " ${mnt} " -name ' *.db.*' | wc -l)
228228 echo " found ${num_found} "
@@ -232,6 +232,14 @@ if [ ${leave_mounted} -eq 0 ]; then
232232 ${XE} pool-dump-database file-name=" ${mnt} /${pool_uuid} .db"
233233 echo done
234234
235+ # clean the old pool database dump
236+ echo -n " Cleaning old DB backups: "
237+ todelete=$( cd " ${mnt} " && ls -1tr ${pool_uuid} .db* | head -n -${history_kept} | xargs echo)
238+ for dbfile in ${todelete} ; do
239+ rm -f " ${mnt} /${dbfile} "
240+ done
241+ echo done
242+
235243 # backup the VM metadata for each VM in the pool into a dated directory
236244 datetime=$( date +%F-%H-%M-%S)
237245 metadir=" ${mnt} /metadata/${datetime} "
You can’t perform that action at this time.
0 commit comments