For my new project, I needed to aggregate user view counts periodically. After i googling around, i figured using cronjob probably was the most popular way of doing it. So i wrote my sql queries to a file and schedule a cronjob to execute the script every 30 minutes. Here are the detail steps of how i did it:
1.Write sql queries to a text file named recurring-job.sql. Put it under your user’s home directory /home/[user].
2.Edit cronjob by issuing following commands.
3. Add a new line into cronjob configuration. This configuration will execute the sql script every 30 minutes.
4. Hit ctrl-X and type “Yes” to save and exit.
That’s it! But how do I make sure the job actually run?