Run simple schedule task in Linux.

Edison Devadoss
2 min readMar 10, 2020

--

In this article, I will explain how to run a command in a particular schedule.

Google image

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.

Screenshot

These are just the basic things of crontab concept.

--

--

Edison Devadoss
Edison Devadoss

Written by Edison Devadoss

Software Engineer / Full Stack Developer / JavaScript / React / React Native / Firebase / Node.js / Book Reader

No responses yet