[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cron setup



> 
> > 
> >    I know the basics of cron and its crontab file, but have a couple of
> > questions about the specifics of how Debian implements cron.  In other
> > words, I've never seen cron divided with subdirs for daily, weekly,
> > monthly, etc.  I get the point of doing things daily or weekly, but I
> > wonder what about the specific time to do these events..
> 
The biggest difference in how Debian handles things wrt the subdirectories
is the run-parts program.  Check out the manpage for some more information
on how it works.

Basically, scripts in any language can be run routinely (daily, weekly, monthly)
with only one crontab entry.  This allows packages to add scripts without
munging-up the crontab file.  The only downside is that the system looses
the ability to specify a time for a particular script to be run.

> The scripts in cron.* don't run magically.  They are run by cron that
> checks /etc/crontab.  Mine looks like:
> ------------------------------------------------------------------------
> # /etc/crontab: system-wide crontab
> # Unlike any other crontab you don't have to run the `crontab'
> # command to install the new version when you edit this file.
> # This file also has a username field, that none of the other crontabs
> do.
> 
> SHELL=/bin/sh
> PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> 
> # m h dom mon dow user  command
> 42 6            * * *   root    run-parts /etc/cron.daily
> 47 6            * * 7   root    run-parts /etc/cron.weekly
> 52 6            1 * *   root    run-parts /etc/cron.monthly
> 30 10,15        * * 1-5 root    /etc/cron.coffee
> * *             * * *   root    atrun -d -l 0.5
> ------------------------------------------------------------------------
> 
> This is pretty much an `ordinary' crontab file with an additional user
> field.  Normal users have the `ordinary' crontab files like they exist
> on other unices.

Personal preference: I like having the entries (and heading) separated by
tabs - it keeps thing nice an orderly.

Like this:

# min	hr	dom	mon	dow	user	command
32	23	*	*	*	root	run-parts /etc/cron.daily
42	23	*	*	7	root	run-parts /etc/cron.weekly
52	23	1	*	*	root	run-parts /etc/cron.monthly

> 
> >    I'm at a point to where I want to run a mirror process to fire off
> > daily at about 1:00 am local.  Could someone outline the best way for me
> > to implement this into Debian's cron setup?
> 
> You can add your script to /etc/cron.daily and change the time these
> scripts are run from 6:42 am to 1:00 am, or you can add an extra item
> running your script.
> 
If you want your mirror updated at a particular time, you'll need to add
an entry into /etc/crontab yourself.  If having it run *approximately* the
same time each day is close enough, then add you script to /etc/cdron.daily.


-- 
Chuck Stickelman, Owner			E-Mail:	<stick@richnet.net>
Practical Network Design		Voice:	(419) 529-3841
9 Chambers Road				FAX:	(419) 529-3625
Mansfield, OH 44906-1302 USA


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: