Date: Sat, 24 Feb 2001 18:53:19 -0600 From: Mike Meyer <mwm@mired.org> To: Christopher Farley <chris@northernbrewer.com> Cc: questions@freebsd.org Subject: Re: crontab for root Message-ID: <15000.22399.830335.325684@guru.mired.org> In-Reply-To: <7863846@toto.iv>
next in thread | previous in thread | raw e-mail | index | archive | help
Christopher Farley <chris@northernbrewer.com> 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. <mike -- Mike Meyer <mwm@mired.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15000.22399.830335.325684>