A common need, when building a web-application (or any database-driven application) is to create batch scripts that can do processing external to the request/response cycle of the app itself.
Below is a skeleton for writing your own scripts that make use of your TG2.0 app environment and models.