background img
banner
Dec 26, 2013
390 Views
0 0

What’s a cron and crontab?

Written by
banner

Cron is a a time-based job scheduler in Unix/Linux environments. Cron can be used to schedule jobs to run periodically at fixed times, dates or intervals.  Crontab is a configuration file that specifies  shell  commands to run periodically on a given schedule.

Users can have their own individual crontab files and often there is a system wide crontab file (usually in /etc or a subdirectory of /etc) that only system administrators can edit.

Crontab format

MIN  HOUR DOM MON DOW <command to execute>

  1. MIN =Minute(0-59)
  2. HOUR =HOUR(0-23)
  3. DOM =Day Of Month(1-31)
  4. MON =Month(1-12)
  5. DOW =Day Of Week(0-6)

cron

How to view crontab entries?

To view current user’s crontab, use “crontab -l

eg :

cron1

 

 

To view other user’s crontab, login as root and give “crontab -u sam -l

cron2

 

 

How do I edit crontab entries?

We can issue “crontab -e”  for adding or editing crontab entries.

 

Article Tags:
Article Categories:
technews
banner

Comments to What’s a cron and crontab?

  • Good one.. I wish if u can write 1-2 guest posts for our blog too. Please message me if you can write. Thanks

    Hosting Fever March 17, 2016 9:34 pm Reply

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.