Quickzi: How To Set Cron to Run Every 5 Minutes

Here is a quick tip on how to run crontab every 5 minutes.

*/5 * * * * /home/adam/script.sh will execute script.sh every 5 minutes.

Also, here’s a quick guide to understaning the layout of cron:
5 * * * * echo 'Hello'

Also, the Crontab Man page

For further reading on Crontab check out Understand Cron Jobs in 5 Minutes

12 thoughts on “Quickzi: How To Set Cron to Run Every 5 Minutes

  1. Thank you for the quick and easy post. I haven’t used cron in forever and I’m not too interested in learning it all again either. I needed to run something for a client every 5 minutes and needless to say this post was quite helpful!

  2. This may be much simpler “than reading stupid man pages” but it’s WRONG!!!!!

    It will run the cron job at five minutes after every hour.

    You want something like:

    0,5,10,15,20,25,30,35,40,45,50,55 * * * * echo ‘Hello’

  3. Actually, according to “the stupid man pages”, */5 will cause it to run every 5 minutes. ;-)

    from cron(5)

    Step values can be used in conjunction with ranges. Following a range
    with “” specifies skips of the number’s value through the
    range. For example, “0-23/2″ can be used in the hours field to specify
    command execution every other hour (the alternative in the V7 standard
    is “0,2,4,6,8,10,12,14,16,18,20,22″). Steps are also permitted after
    an asterisk, so if you want to say “every two hours”, just use “*/2″.

  4. .—————- 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

    This will give still more detailed info for cron.

  5. Pingback: Need to be able to set cron to reboot system every 5 min

  6. What about on AIX 5.3, when I try to save
    */5 * * * * /user/home/user1/test.sh
    I get a

    contains the following error:
    0481-079 Reached a symbol that is not expected.

  7. HATCH: Each unix system has its own crontab specifics, I truly recommend that you do not blindly apply settings from linux on aix. Read man cron or man crontab. However I can confirm that the above line works also on NetBSD and OpenBSD.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>