> **Question**: I would like to schedule a task on my Linux box, so that the task runs periodically at fixed times. How can I add a cron job for this task on my Linux system?
The cron utility is the default task scheduler used in Linux. Using cron, you can schedule a task (e.g., a command or a shell-script) to run it periodically or one-time at a specific time of hour, day, week, month, etc. The cron tool is useful when you schedule a variety of regular maintenance jobs, such as periodic backup, rotating logs, checking filesystem, monitoring disk space, and so on.
### Add a Cron Job from the Command Line ###
To add a cron job, you can use a command-line tool called crontab.
Type the following command to create a new cron job to run as the current user.
$ crontab -e
If you want a cron job to run as any other user, type the following command instead.
$ sudo crontab -u <username> -e
You will be presented with a text editor window, where you can add or edit cron jobs. By default, nano editor will be used.
The first five elements specify the schedule for a task, and the last element is the (full-path) command or script to execute according to the schedule.