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 'man crontab' on your Solaris box to find out the format of each field.
--
Chris
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.
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 pm, 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,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]
It's Vixie Cron syntax if you want to be accurate.
Shades of VAX/VMS batch. It works, but if anything goes wrong so as to
prevent the resubmission you loose your job.
--
Tom Schulz
sch...@adi.com