Crontab

Cron (crond) daemon or service is use to execute scheduled commands or scripts. Cron wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute.(source)

Crontab Guru

The quick and simple editor for cron schedule expressions

https://crontab.guru/

Task: Start cron service

ON RHEL/Centos Linux 7.x user:


# systemctl start crond.service

Task: Stop cron service

OR RHEL/Centos Linux 7.x user:


# systemctl stop crond.service

Task: Restart cron service

To restart the cron service, use:

OR RHEL/Centos Linux 7.x user:


# systemctl restart crond.service

Task: Test if cron is working

Add the following entry to your crontab. To do so, enter the command


crontab -e

And then add:

* * * * * /bin/echo "foobar" >> /your-path/your-file-name.txt

After a minute, a file should be created under the specified path, holding the “foobar” content. If you can see the file, congrats, cron is working fine.

(source)