From owner-freebsd-questions Sat Feb 24 16:53:24 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 2CE1637B401 for ; Sat, 24 Feb 2001 16:53:21 -0800 (PST) (envelope-from mwm@mired.org) Received: (qmail 43802 invoked by uid 100); 25 Feb 2001 00:53:19 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15000.22399.830335.325684@guru.mired.org> Date: Sat, 24 Feb 2001 18:53:19 -0600 To: Christopher Farley Cc: questions@freebsd.org Subject: Re: crontab for root In-Reply-To: <7863846@toto.iv> X-Mailer: VM 6.89 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Christopher Farley types: > Matthew Emmerton (matt@gsicomp.on.ca) wrote: > > This means that I have *two* root crontabs - the standard one in > > /etc/crontab, and my custom one in /var/cron/tabs/root. > > > > Is there anything wrong with this type of setup? More importantly, why > > would you add 'custom' mods to /etc/crontab when you can use 'crontab -e' > > to update the one in /var/cron/tabs/root? (The advantage I've seen is that > > when you upgrade, all of your custom mods to root's crontab won't be blown > > away if you accidentally install the /usr/src version of /etc/crontab.) > Two crontabs? I think you are being far too simplistic. You ought to > keep jobs scattered about in root's personal crontab, /etc/crontab, > *and* in /etc/periodic/*. Why would you want to make life easy for those > who would inherit your job? No, no, no - not *nearly* enough. You also want stuff in /etc/periodic/*, /usr/local/etc/periodic/*, ${PREFIX}/periodic/* and a few other periodic/* trees. Realisticly, I: 1) Never touch /etc/crontab (so I don't have to fool with it during upgrades). 2) Never touch /etc/periodic/* - /etc/periodic.conf is sufficient. If it isn't, patch things and PR the patch. 3) Put thing in /usr/local/periodic/* by default. That takes care of almost everything you normally want to do from crontab. 4) The rest goes in crontabs for the appropriate user via crontab -e, though some users have their own ~/periodic/* setup. 5) Log and document everything. Note that periodic is a huge step forward! Before it, /etc/crontab (or roots crontab, depending on your religious preferences) was filled with long lists of things to do each day/week/month, and you had to worry about system load and sequencing. By driving all the daily/weekly/monthly things from one script, you get absolute control of the sequencing and load. Which is why I encourage users to use periodic if they have to do more than one thing on a daily/weekly/monthly schedule. I'd like to see two changes that I think are improvements: running weekly & monthly from the daily script, to control when/how it's run; and providing a hook in the system periodics to run user scripts. However, others don't seem to agree that these are improvements. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message