Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

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/StartDip.sh > /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?

Thanks,
Pattabi.
Posted

1 solution

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

MSIL
svcadm restart svc:/system/cron


Let me know if this information helped you.


BR//
Harsha
 
Share this answer
 
Comments
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

BR//
Harsha

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900