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:
# MIN HOUR DAYOFMONTH MONTH DAYOFWEEK COMMAND
5 * * * * echo 'Hello'
Also, the Crontab Man page
For further reading on Crontab check out Understand Cron Jobs in 5 Minutes
Popularity: 100% [?]
Tagged with: cron • crontab • HowTo • Linux • quickzi • tips • tricks
Like this post? Subscribe to my RSS feed and get loads more!













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!
great! much better than reading stupid man pages.
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’
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″.
.—————- 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 * * * * command
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.
*/5 throws an error on AIX 5 reading “Reached a symbol that is not expected”
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.
Greetings
Kolaloka
Try 0-59/5 * * * *
if your cron not supported */5 * * * * command
0-59/5 * * * * echo “worked for me, thnx” > cron-results.txt