Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Linux
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 25-Apr-11 1:54am
rprtech268

1 solution

Rate this: bad
good
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.
 

BR//
Harsha
  Permalink  
Comments
rprtech at 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 at 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 at 28-Apr-11 7:22am
   
Hi your soln has worked. Thank you very much.....
ZeeroC00l at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 504
1 Maciej Los 349
2 Kornfeld Eliyahu Peter 325
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,303
1 DamithSL 4,764
2 Maciej Los 4,306
3 Kornfeld Eliyahu Peter 3,914
4 Sergey Alexandrovich Kryukov 3,538


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 25 Apr 2011
Copyright © CodeProject, 1999-2014
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