Posts

Showing posts with the label scheduler

Setting up or scheduling a task or cron job in Django

Image
  Hey folks! I’ve got something interested to share which I recently learned. You already know it, don’t you? Yes, from the title. Well then, let’s get start with it. When working on a project, you might require to setup a cron job. Those who don’t know what a cron job is, “cron” is a utility that schedule scripts or commands to be run automatically at specified time and date or intervals and these tasks or jobs are what we call as “cron job”. Every *nix system has a default cron utility. Crons are identified by  crontab (cron-tab file), a configuration file that specifies the commands to be run periodically. However, to set up a cron job in Django, we can make use of a third party module which I found really useful,  django-crontab How to write a cron job? Before we go any further, we must understand the syntax in which a cron job is defined. Yes, a cron job has a specified format which can be understand by the cron utility. The main part of a cron is its timing syntax which defines t