As this is something almost all newbies might find helpful, I've cc'ed it
back to the list.

No problem. you don't want man crontab -- you want man 5 crontab. (Sad
that I know this off the top of my head). One of the tricks to know about
man is that there's often more than one man page for a command. You can
find extra man pages by the following (or several other) methods:

locate crontab | grep man

In this case, you'll see there's one in man1 (the default man) and in man5
(which is invoked by man 5).

First, you never edit /etc/crontab directly. Use crontab -e (for
edit) instead.

Let's say you want to start a job named foo at 5 pm every day of the week:

0 17 * * * foo

and you wanted to kill it with a kill script named killfoo at 7:30 am
every day:

30 7 * * * killfoo

There are other examples in the man 5 crontab for monthly, etc.

On Fri, 26 Feb 1999, Dan Browning (Network Admin) wrote:

> Thanks for the great tips, but I'm having troubling making crontab entries.
> I read the crond and crontab man page, but that didn't help much.  Should I
> make a crontab file in /var/spool/cron with my username as a file name like
> the man page says or should I add it to /etc/crontab?  What's the
> difference?  Could I make a crontab in my home directory?  We need a faq or
> howto on this.
> 
> Here's my /etc/crontab:
> 
> ----------------------------------------------------
> SHELL=/bin/bash
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> MAILTO=root
> 
> # run-parts
> 01 * * * * root run-parts /etc/cron.hourly
> 02 1 * * * root run-parts /etc/cron.daily
> 02 2 * * 0 root run-parts /etc/cron.weekly
> 02 3 1 * * root run-parts /etc/cron.monthly
> ----------------------------------------------------
> 
> I don't know what it means, and I don't know what to add in order to execute
> my process.  And I still don't see how to schedule the times in there.  I
> must REALLY be missing something.
> 
> Thanks in advance for your help.
> -dan
> 
> 
> 
> > -----Original Message-----
> > From: Deirdre Saoirse [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 26, 1999 6:34 AM
> > To: Dan Browning (Network Admin)
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: Scheduling programs for specific times, how is it done?
> >
> >
> > You can use cron at 7:30 to kill the job by name. suppose
> > your process was
> > started at 5 pm and is named foo.
> >
> > Then you'd enter a crontab entry to, at 7:30, "killall foo"
> >
> > On Thu, 25 Feb 1999, Dan Browning (Network Admin) wrote:
> >
> > > I understand cron.daily, .hourly, etc.  But I would like to
> > have a program
> > > run at a specific time (say, 5:00pm every night), and then
> > be killed the
> > > next morning at 7:30am.  How can this be done?
> >
> > _Deirdre  *  http://disclaimer.deirdre.org  *  http://www.deirdre.net
> > "I would rather choose to have my leg bitten off than to buy NT"
> > Rob Narberes, Information Systems Manager, DNA Plant Technologies Corp
> > as quoted in (!) Computerworld
> >
> 

_Deirdre  *  http://disclaimer.deirdre.org  *  http://www.deirdre.net
"I would rather choose to have my leg bitten off than to buy NT"
Rob Narberes, Information Systems Manager, DNA Plant Technologies Corp
as quoted in (!) Computerworld

Reply via email to