August 2016
Beginner to intermediate
717 pages
15h 24m
English
Usually websites have some management tasks to do in the background once in a week, day, or every hour. This can be achieved using cron jobs that are also known as scheduled tasks. These are scripts that run on the server for the specified period of time. In this recipe, we will create two cron jobs: one to clear sessions from the database and another to back up the database data. Both will be run every night.
To start with, deploy your Django project on to a remote server. Then, connect to the server by SSH.
Let's create the two scripts and make them run regularly by following these steps:
commands, db_backups and logs directories in your project's home directory:
(myproject)myproject@server$ ...Read now
Unlock full access