Perform a database backup when closing the application