Cron Jobs

Another way to execute code based on time is to use a cron job. A cron job is code that executes at a specified time. One of the most common uses of cron jobs is in backing up files. You can create a cron job that backs up all the files that you modified during the day and set that cron job to run every night at 10:00 PM. After you’ve set your cron job, your computer will never forget to do the backup, and you don’t have to think about it. Creating cron jobs is outside the scope of this book, but if they sound interesting to you, a quick Google search will help you get started.

Get Learning to Program now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.