improve backup and maintenance script. correct db keep duration