How to set cron job in linux for a specific time
[dropcap]A[/dropcap] developer or a system administrator knows the importance of setting up a cron job (schdueled task) to run specific task automatically through the system.
In this tutorial let’s see how we can set up a cron job in linux system.
To set a cron job first we must open the cron tab by using the following command,
crontab -e or vi /etc/crontab
By executing the above command in shell we now opened the cron tab,
Now to set a specific task to run on a specific time we have to use the following command,
59 23 * * * home/path/to/command/the_command.sh
| Hours [0-23]
| | Days [1-31]
| | | Months [1-12]
| | | | Days of the Week [Numeric, 0-6]
| | | | |
* * * * * home/path/to/command/the_command.sh
The above command will executed the file specified in the path mentioned to run everday at