Unix or Linux Crontab Headers

Even though cron is our usual lifesaver for redundant tasks on a Unix or Linux Systems, there are times that we really forget the syntax that is needed for our cronjobs. Here is a simple yet effective headers that we could place on top of the crontab as comments:

###############################################################
#.---------------- minute (0 - 59)
#|  .------------- hour (0 - 23)
#|  |  .---------- day of month (1 - 31)
#|  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
#|  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)  OR
#|  |  |  |  |         sun,mon,tue,wed,thu,fri,sat
#|  |  |  |  |
*  *  *  *  *  command to be executed

Readers who found this post were searching for:

  • crontab header


Comments