dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

Run Cron Job every 2 minutes interval - solaris

This is a discussion on Run Cron Job every 2 minutes interval - solaris ; 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 ...


Home > Database Forum > Operating Systems > solaris > Run Cron Job every 2 minutes interval

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-14-2008, 04:25 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Run Cron Job every 2 minutes interval

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
Reply With Quote
  #2  
Old 11-14-2008, 04:36 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: Run Cron Job every 2 minutes interval

On 2008-11-14 20:25:17 +0000, Prachet 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

Reply With Quote
  #3  
Old 11-14-2008, 05:53 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: Run Cron Job every 2 minutes interval

On Nov 14, 12:25 pm, Prachet 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,3 6,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.
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 08:43 AM.