Run simple schedule task in Linux.
In this article, I will explain how to run a command in a particular schedule.
In Linux operating system there is a command called ‘crontab’. Using crontab command we can run commands on schedule.
crontab does not execute any function after the system turned off. But anacron is the tools for run command after system turned off.
Linux Crontab Format
MIN HOUR DOM MON DOW CMD
Example
$ crontab -l
The above command list all the command we already set.
$ crontab -e
The above command is for edit command.
*/1 * * * * /usr/local/bin/node /home/Edison/L/node/POC/randomClusterValue/index.js
The above command, I have written the code to run a JavaScript random value generator. And this command I have set the timing to schedule. The above command runs each minute.
These are just the basic things of crontab concept.