Run crontab Every 10 Minutes

by Vivek Gite on February 6, 2008 · 4 comments

Q. How do I run a cron job or a shell script every 10 minutes using Linux / UNIX cron service?

A. cron is a time-based scheduling service in Linux / Unix-like computer operating systems.

Login to UNIX system

Type the following command to enter cronjob:
$ crontab -e
Each cronjob has following syntax:

# +---------------- minute (0 - 59)
# |  +------------- hour (0 - 23)
# |  |  +---------- day of month (1 - 31)
# |  |  |  +------- month (1 - 12)
# |  |  |  |  +---- day of week (0 - 6) (Sunday=0 or 7)
# |  |  |  |  |
  *  *  *  *  *  command to be executed

To get crontab to run a task every 10 minutes you could type as follow
*/10 * * * * /path/to/command
Save and close the file.

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 4 comments… read them below or add one }

1 rockie June 27, 2008

*/10 * * * * /home/test.sh > /dev/null 2>&1
crontab: error on previous line; unexpected character found in line.
crontab: errors detected in input, no crontab file generated.

Guess it does not work in Solaris 8

Reply

2 budacsik September 21, 2008

OR

sudo -i
cd /etc/cron.d
touch command
vi command
# in command file
MAILTO=rootmail@foo.bar
*/10 * * * * /path/to/command

# save command file and exit
if you do not want to receive a letter then
MAILTO=”"

Reply

3 dakota July 23, 2009

yeah, budacsik. why use one command when you can use 4 :)))

Reply

4 ahah November 25, 2011

yes, just one line
sudo vi /etc/cron.d/command

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 4 + 4 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: