Unix Technical Forum

Solaris crontab, quickly repeating job?

This is a discussion on Solaris crontab, quickly repeating job? within the Sun Solaris Administration forums, part of the Solaris Operating System category; --> Hello, I need to setup a cron job which should be executing every five minutes, in Linux I could ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 11:17 AM
Tomi Hakala
 
Posts: n/a
Default Solaris crontab, quickly repeating job?

Hello,

I need to setup a cron job which should be executing every five minutes,
in Linux I could do "*/5 * * * * blah" but this does not work on Solaris.

Do I need to type all the minutes when I wish to run the job or is there
any other way to do it?

I am using Solaris 10u2.

Tomi
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 11:17 AM
Mariusz Wolek
 
Posts: n/a
Default Re: Solaris crontab, quickly repeating job?


Uzytkownik "Tomi Hakala" <tomi.hakala@clinet.fi> napisal w wiadomosci news:45e7f177$0$31518$39db0f71@news.song.fi...

> Hello,
>
> I need to setup a cron job which should be executing every five minutes,
> in Linux I could do "*/5 * * * * blah" but this does not work on Solaris.
>
> Do I need to type all the minutes when I wish to run the job or is there
> any other way to do it?



try: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * blah

MaW
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 11:17 AM
Tomi Hakala
 
Posts: n/a
Default Re: Solaris crontab, quickly repeating job?

Mariusz Wolek wrote:
> try: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * blah


But this is exactly what I would like to avoid ..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 11:17 AM
Richard B. gilbert
 
Posts: n/a
Default Re: Solaris crontab, quickly repeating job?

Tomi Hakala wrote:
> Mariusz Wolek wrote:
>
>> try: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * blah

>
>
> But this is exactly what I would like to avoid ..



Maybe you should use Linux?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-16-2008, 11:17 AM
Daniel Rock
 
Posts: n/a
Default Re: Solaris crontab, quickly repeating job?

Tomi Hakala <tomi.hakala@clinet.fi> wrote:
> Mariusz Wolek wrote:
>> try: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * blah

>
> But this is exactly what I would like to avoid ..


Why? Just because the line is longer?


Then put a line

[ $(($(date +%M) % 5)) -eq 0 ] || exit 0

in your script and let it run with cron every minute.

--
Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-16-2008, 11:17 AM
Tomi Hakala
 
Posts: n/a
Default Re: Solaris crontab, quickly repeating job?

Richard B. gilbert wrote:
> Maybe you should use Linux?


And you should grow up.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-16-2008, 11:17 AM
Tomi Hakala
 
Posts: n/a
Default Re: Solaris crontab, quickly repeating job?

Daniel Rock wrote:
> Why? Just because the line is longer?


There may be need to iterate execution interval and it is a bit difficult
to do with '0,5,10..'.

> Then put a line
> [ $(($(date +%M) % 5)) -eq 0 ] || exit 0
> in your script and let it run with cron every minute.


That will do, thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-16-2008, 11:17 AM
Richard B. gilbert
 
Posts: n/a
Default Re: Solaris crontab, quickly repeating job?

Tomi Hakala wrote:
> Richard B. gilbert wrote:
>
>> Maybe you should use Linux?

>
>
> And you should grow up.


Growing old is mandatory. Growing up is not!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-16-2008, 11:17 AM
Hans Werner Strube, strube&physik3*gwdg*de
 
Posts: n/a
Default Re: Solaris crontab, quickly repeating job?

Daniel Rock <v200709@deadcafe.de> wrote:
> Tomi Hakala <tomi.hakala@clinet.fi> wrote:
>> Mariusz Wolek wrote:
>>> try: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * blah

>>
>> But this is exactly what I would like to avoid ..

>
> Why? Just because the line is longer?
>
>
> Then put a line
>
> [ $(($(date +%M) % 5)) -eq 0 ] || exit 0
>
> in your script and let it run with cron every minute.


But note that cron will generate three lines in /var/cron/log for each
execution, thus your log will rapidly grow ...

--

Hans Werner Strube strube(@)physik3(.)gwdg(.)de
Drittes Physikalisches Institut, Univ. Goettingen
Friedrich-Hund-Platz 1, 37077 Goettingen, Germany
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-16-2008, 11:17 AM
Michael Vilain
 
Posts: n/a
Default Re: Solaris crontab, quickly repeating job?

In article <45E835A9.90902@comcast.net>,
"Richard B. gilbert" <rgilbert88@comcast.net> wrote:

> Tomi Hakala wrote:
> > Mariusz Wolek wrote:
> >
> >> try: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * blah

> >
> >
> > But this is exactly what I would like to avoid ..

>
>
> Maybe you should use Linux?


Tomi, I think Richard's post was meant as true advise. Solaris is not
Linux, as you may have guessed. If you want the syntax of Linux's cron,

you can port the crond from Linux to Solaris and run it or
run Linux instead of Solaris or
setup your cron job using traditional cron syntax.

If you want to get huffy about "growing up", perhaps it's time to do so.

Youth is _so_ wasted on the young.

--
DeeDee, don't press that button! DeeDee! NO! Dee...



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:24 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com