Categories
Linux

Setting up a crontab / cronjob on Linux

Step 01

List the cronjobs of the current user

crontab -l

Step 02

Edit the cronjobs of the current user

crontab -e

Step 03

Add a cronjob that writes the current time every minute

* * * * * date | tee --append /var/www/html/time.log

Step 04

What does * * * * * mean?

.---------------- minute (0 - 59)
|  .------------- hour (0 - 23)
|  |  .---------- day of month (1 - 31)
|  |  |  .------- month (1 - 12)
|  |  |  |  .---- day of week (0 - 7)
|  |  |  |  |
*  *  *  *  *

Step 05

Watch the cronjob log file

tail --follow /var/www/html/time.log

Leave a Reply

Your email address will not be published. Required fields are marked *