Run Cron Job every 2 minutes interval

  • Follow


Hi All

I want my cron job to run at every 2 minutes interval in all hours,
days, months etc.
OS - Sun Solaris
Release Level -5.10

I tried with */2 * * * * filename but it failed.

How to do that?

Regards
Prachet
0
Reply Prachet 11/14/2008 8:25:17 PM

On 2008-11-14 20:25:17 +0000, Prachet <prachetmohanty@gmail.com> said:

> Hi All
> 
> I want my cron job to run at every 2 minutes interval in all hours,
> days, months etc.
> OS - Sun Solaris
> Release Level -5.10
> 
> I tried with */2 * * * * filename but it failed.
> 
> How to do that?

Try 'man crontab' on your Solaris box to find out the format of each field.

-- 
Chris

0
Reply Chris 11/14/2008 8:36:07 PM


On Nov 14, 12:25 pm, Prachet <prachetmoha...@gmail.com> wrote:
> Hi All
>
> I want my cron job to run at every 2 minutes interval in all hours,
> days, months etc.
> OS - Sun Solaris
> Release Level -5.10
>
> I tried with */2 * * * * filename but it failed.
>
> How to do that?
>
> Regards
> Prachet

Try this -- all on one line --

0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,49,50,52,54,56,58
* * * * filename

Sure, it looks inelegant, but elegance costs extra.  Remember, my
advice is worth every penny you paid for it!

Alternatively, use "at" instead of "cron".  Set up a script:

#!/bin/sh
# Script named "myScript"
at now + 2  minutes <<!
/pathTo/myScript
!
..... perform my script functions ...
#end myScript

Hope that's helpful.
1
Reply ThanksButNo 11/14/2008 9:53:37 PM

In article 
<45c7e182-b9d6-4834-bda1-d754bee61f4e@40g2000prx.googlegroups.com>,
 Prachet <prachetmohanty@gmail.com> wrote:

> Hi All
> 
> I want my cron job to run at every 2 minutes interval in all hours,
> days, months etc.
> OS - Sun Solaris
> Release Level -5.10
> 
> I tried with */2 * * * * filename but it failed.
> 
> How to do that?
> 
> Regards
> Prachet

This is Linux syntax for crontab.  Solaris' crontab syntax is available 
under it's man page.

-- 
DeeDee, don't press that button!  DeeDee!  NO!  Dee...
[I filter all Goggle Groups posts, so any reply may be automatically by ignored]


0
Reply Michael 11/15/2008 8:02:16 AM

On 2008-11-14, ThanksButNo <no.no.thanks@gmail.com> wrote:
> On Nov 14, 12:25 pm, Prachet <prachetmoha...@gmail.com> wrote:
>> Hi All
>>
>> I want my cron job to run at every 2 minutes interval in all hours,
>> days, months etc.
>> OS - Sun Solaris
>> Release Level -5.10
>>
>> I tried with */2 * * * * filename but it failed.
>>
>> How to do that?
>>
>> Regards
>> Prachet
>
> Try this -- all on one line --
>
> 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,49,50,52,54,56,58
> * * * * filename

49?    :o)

> Sure, it looks inelegant, but elegance costs extra.  Remember, my
> advice is worth every penny you paid for it!
>
> Alternatively, use "at" instead of "cron".  Set up a script:
>
> #!/bin/sh
> # Script named "myScript"
> at now + 2  minutes <<!
> /pathTo/myScript
> !
> .... perform my script functions ...
> #end myScript

Alternatively, have the script that's run check to see if it's an even minute,
and otherwise exit.


-- 
   "I have never been able to conceive how any rational being could propose
happiness to himself from the exercise of power over others." - Thomas Jefferson
               [email me at huge {at} huge (dot) org <dot> uk]
0
Reply Huge 11/15/2008 9:45:13 AM

#!/bin/sh
# Script named "myScript"
at now + 2  minutes <<!
/pathTo/myScript
!
..... perform my script functions ...
#end myScript

Threr is a mistake or limitation in above method, you don't calculate
the time which "myscript" run.
You can add a "&" after "/pathTo/myScript"



On Nov 15, 5:45=A0pm, Huge <H...@nowhere.much.invalid> wrote:
> On 2008-11-14, ThanksButNo <no.no.tha...@gmail.com> wrote:
>
>
>
> > On Nov 14, 12:25 pm, Prachet <prachetmoha...@gmail.com> wrote:
> >> Hi All
>
> >> I want my cron job to run at every 2 minutes interval in all hours,
> >> days, months etc.
> >> OS - Sun Solaris
> >> Release Level -5.10
>
> >> I tried with */2 * * * * filename but it failed.
>
> >> How to do that?
>
> >> Regards
> >> Prachet
>
> > Try this -- all on one line --
>
> > 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,4=
9,50,52,54,56,58
> > * * * * filename
>
> 49? =A0 =A0:o)
>
> > Sure, it looks inelegant, but elegance costs extra. =A0Remember, my
> > advice is worth every penny you paid for it!
>
> > Alternatively, use "at" instead of "cron". =A0Set up a script:
>
> > #!/bin/sh
> > # Script named "myScript"
> > at now + 2 =A0minutes <<!
> > /pathTo/myScript
> > !
> > .... perform my script functions ...
> > #end myScript
>
> Alternatively, have the script that's run check to see if it's an even mi=
nute,
> and otherwise exit.
>
> --
> =A0 =A0"I have never been able to conceive how any rational being could p=
ropose
> happiness to himself from the exercise of power over others." - Thomas Je=
fferson
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[email me at huge {at} huge (dot) org <dot=
> uk]

0
Reply u2chcai 11/16/2008 2:02:42 PM

Michael Vilain <vilain@nospamcop.net> wrote:
> In article 
> <45c7e182-b9d6-4834-bda1-d754bee61f4e@40g2000prx.googlegroups.com>,
> Prachet <prachetmohanty@gmail.com> wrote:
> 
>> Hi All
>> 
>> I want my cron job to run at every 2 minutes interval in all hours,
>> days, months etc.
>> OS - Sun Solaris
>> Release Level -5.10
>> 
>> I tried with */2 * * * * filename but it failed.
>> 
>> How to do that?
>> 
>> Regards
>> Prachet
> 
> This is Linux syntax for crontab.  Solaris' crontab syntax is available 
> under it's man page.

It's Vixie Cron syntax if you want to be accurate.
0
Reply Cydrome 11/18/2008 4:37:30 PM

>Alternatively, use "at" instead of "cron".  Set up a script:
>
>#!/bin/sh
># Script named "myScript"
>at now + 2  minutes <<!
>/pathTo/myScript
>!
>.... perform my script functions ...
>#end myScript
>
>Hope that's helpful.

Shades of VAX/VMS batch.  It works, but if anything goes wrong so as to
prevent the resubmission you loose your job.
-- 
Tom Schulz
schulz@adi.com
0
Reply schulz 11/18/2008 6:44:23 PM

7 Replies
1265 Views

(page loaded in 0.082 seconds)

Similiar Articles:













7/20/2012 7:13:08 AM


Reply: