Click here to Skip to main content
13,052,956 members (64,156 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I am trying to run a process for every 2 min. Though manually job is running, if I create crontab entry it is not running.Entry is as below

2 * * * * /usr/ > /tmp/otpt

If I try to give as */2 * * * * , it is giving error as "Failed to create entry"

How to create an entry which should run for every 2 min , in Solaris-10?

Posted 25-Apr-11 0:54am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The cron tab format is as folllows.
m(0-59) h(0-23) dom(1-31) m(1-12) dow(0-6) command

And the format you are following is valid for a cron that is supposed to run every 2 minute.

for creating a cron you can use
crontab -e
which I am pretty sure you know.

Your prob may be caused due to some problem in cron. Try restarting the cron once using

svcadm restart svc:/system/cron

Let me know if this information helped you.

rprtech 25-Apr-11 7:19am
Hi Harsha,
I executed the above command and tested the crontab entry. but it is not working...My job is not starting at all :-( But it is running properly if I give it for every minute( * * * * * <path>)
I am very much confused...Is there any other way ????
ZeeroC00l 25-Apr-11 7:50am
2 * * * * wont execute the cron for every 2 minutes. It executes the cron 2 minute after an hour. That is why the cron is not running when you use 2 * * * *. The time to run the cron was not achieved there.

using */2 * * * * should solve the problem as this means every 2 minute. But since you said you are having problem with this why dont you try another method wich is rather tedious.

0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,3 6,38,40,42,44,46,48,49,50,52,54,56,58 * * * *
rprtech 28-Apr-11 7:22am
Hi your soln has worked. Thank you very much.....
ZeeroC00l 28-Apr-11 11:03am
Glad i could help


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 25 Apr 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100