modified to clean out the database for logs over one month