How to Schedule Tasks with Cron Jobs


 Introduction

Cron jobs allow you to schedule tasks automatically, making system administration easier.


Step 1: Edit the Crontab


crontab -e


➡️ Opens the cron table for the current user.


Step 2: Add a Cron Job


0 2 * * * /path/to/script.sh


➡️ Runs script.sh every day at 2 AM.


Step 3: List Cron Jobs


crontab -l


➡️ Shows all scheduled cron jobs.


Conclusion

Cron jobs automate repetitive tasks, saving time and ensuring consistency.

Comments