updated the backup db routine to work similar to RotatingLogFiles