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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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 |
| |||
| 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 |
| |||
| 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! |
| |||
| 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 |
| ||||
| 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... |