Thanks in advance.
SK
> I'd like to run a cron job every 5 min.
man is your friend ;-)
*/5 * * * * YOUR_COMMAND
this will do the job.
--
M.C.S.E :- Minesweeper Consultant & Solitaire Expert
"GPG-KEY on demand"
*/5 * * * *
With this entry, your job is running all five Minutes.
regards,
André
Check your man page to see if your version of cron and/or crontab supports
the */5 construct.
hymie! http://www.smart.net/~hymowitz hy...@lactose.smart.net
===============================================================================
> On Wed, 16 Apr 2003 14:59:36 +0200, Hugh Kang wrote:
>
> > I'd like to run a cron job every 5 min.
>
> man is your friend ;-)
>
> */5 * * * * YOUR_COMMAND
>
> this will do the job.
Not every system supports this syntax. When giving an answer that's
system-dependent, it's a good idea to qualify it as such.
The OP should have indicated what system he's using, but since he
didn't, we don't know whether this will work for him or not.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Uli> On Wed, 16 Apr 2003 14:59:36 +0200, Hugh Kang wrote:
>> I'd like to run a cron job every 5 min.
Uli> man is your friend ;-)
Uli> */5 * * * * YOUR_COMMAND
I prefer giving a start minute, so I can keep everything from hitting
at the top of the hour at once:
1-59/5 * * * * COMMAND
that fires at 1, 6, 11, 16 etc.
If I had another one, I use:
2-59/5 * * * * COMMAND
to fire at 2, 7, 2, 17, etc.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
I am with SCO UnixWare 7.1.1. "*/5" doesn't work on our system. I've got
"unexpected character found in line". I checked man crontab but it doesn't say
anything about it clearly. Anyone else please?
Thanks
Hugh
> I am with SCO UnixWare 7.1.1. "*/5" doesn't work on our system. I've got
> "unexpected character found in line". I checked man crontab but it doesn't say
> anything about it clearly. Anyone else please?
If your system's version of cron doesn't support that sort of thing, I
guess your two options are to live with it, or to build a version of
cron which does support it. Of the two options, I'd just deal with it,
personally.
What can "anyone else" say? Either your system supports it or it doesn't.
If it doesn't, you go back to the standard syntax that you already know.
I suppose you could install the cron daemon from FreeBSD or Linux -- I
expect they will work in most other flavors of Unix as well.
--
Barry Margolin, barry.m...@level3.com
Genuity Managed Services, a Level(3) Company, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
You can make multiple entries that call the same thing at different times.
-- ced
--
Chuck Dillon
Senior Software Engineer
NimbleGen Systems Inc.
Barry Margolin wrote:
> Hugh Kang <sk...@leaguedata.com> wrote:
>>I am with SCO UnixWare 7.1.1. "*/5" doesn't work on our system. I've got
>>"unexpected character found in line". I checked man crontab but it doesn't say
>>anything about it clearly. Anyone else please?
> What can "anyone else" say? Either your system supports it or it doesn't.
> If it doesn't, you go back to the standard syntax that you already know.
>
> I suppose you could install the cron daemon from FreeBSD or Linux -- I
> expect they will work in most other flavors of Unix as well.
It is bad form to troll in the technical newsgroups, Barry. As
"FreeBSD" and "Linux" aren't "flavors of Unix" (no matter how much
penguin heads wish they were), your expectations are far off the mark.
Happy to have cleared things up for you,
Don
--
*************************** Q: How many frenchmen does it take
* Rev. Don McDonald, SCNA * to defend Paris?
* Baltimore, MD * A: No one knows, it's never been tried.
***************************
http://mywebpages.comcast.net/oldno7/TheFrench.mpg
Reluctant Yamaha YZF-R1 Owner
Too long for what? It's a fine, respectable syntax which works
on every cron implementation I know.
You've stated elsewhere that your cron does not support the */5 construct.
Other options are:
a Write a program which you can have cron run every minute, but only performs
the task every 5th invocation.
b Write a daemon that wakes up every 5 minutes and does your task. Run this
at startup.
c Install a different cron which supports a syntax you like better.
d Live with the verbose syntax in your crontab file.
e Live with your process running too often (every minute) or too rarely (every
hour).
f Hire local students to run your command every 5 minutes. Minimum wage
in many US locations will cost you less than $0.50 per invocation.
g Use at rather than cron. Your process can schedule its next invocation with
"echo runmeagain | at now + 5 minutes" each time it's run. There will be
a slight drift, but it won't be much if you reschedule before doing any
work.
h This task probably isn't that important. Run it yourself when needed. Each
time you do, you'll feel good because you just saved 50 cents ;)
If it were me, I'd go with d.
good luck!
--
Mark Rafn da...@dagon.net <http://www.dagon.net/>
--
bill marcum the mushroom-eating laboratory monkey
What kind of monkey are you? http://thesurrealist.co.uk/monkey.cgi
>> >"0,5,10,15,20, -> 55 * * * *" However, this is too long.
>>
>> Check your man page to see if your version of cron and/or crontab supports
>> the */5 construct.
>>
>I am with SCO UnixWare 7.1.1. "*/5" doesn't work on our system. I've got
>"unexpected character found in line". I checked man crontab but it doesn't say
>anything about it clearly. Anyone else please?
Start typing. :)
[snip]
> I am with SCO UnixWare 7.1.1. "*/5" doesn't work on our system. I've got
> "unexpected character found in line". I checked man crontab but it doesn't say
> anything about it clearly. Anyone else please?
>
> Thanks
> Hugh
No, UW does not support the */5 syntax. Why is the older method too long?
If you feel that it makes the crontab listing unreadable, break it up into
multiple lines:
0,10,20,30,40,50 * * * * CMD
5,15,25,35,45,55 * * * * CMD
--
If at first you don't succeed,
read the manual......
Hugh,
You might try opensysmon which allows you to control the execution of
any
job, like cron. It gives a visual interface to what is happening. It
also
if full compatible with cron -- it will monitor cron jobs as well as
it's own
jobs.
--
http://ftp.opensysmon.com is a shell script archive site with an
open source system monitoring and network monitoring software package.
Many platforms are supplied already compiled.
Barry Margolin wrote:
> Hugh Kang <sk...@leaguedata.com> wrote:
>
> >I am with SCO UnixWare 7.1.1. "*/5" doesn't work on our system. I've got
> >"unexpected character found in line". I checked man crontab but it
doesn't say
> >anything about it clearly. Anyone else please?
>
> What can "anyone else" say? Either your system supports it or it doesn't.
> If it doesn't, you go back to the standard syntax that you already know.
>
> I suppose you could install the cron daemon from FreeBSD or Linux -- I
> expect they will work in most other flavors of Unix as well.
Or gcron if the extra numbers annoy him that much.
Barrett