Chapter 12. Create a Console Application to Automate the Periodic Task
In this chapter, we will learn how to write a console application and will discover the main differences between web and console apps.
Then, we will create our first console controller, using a practical example to illustrate how to update a database table.
In the final paragraphs, we will see how to set output colors and text formats and how to implement a complete periodic task, such as sending an e-mail with daily reservations. We will cover the following topics in this chapter:
Interacting with console applications
Creating a console controller
Example – setting an alarm flag for expired reservation
Formatting the output from the console
Implementing and executing cron jobs
Example – sending an e-mail with new reservations of the day