From owner-freebsd-doc@FreeBSD.ORG Fri May 21 10:00:58 2004 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B7BBE16A4CE for ; Fri, 21 May 2004 10:00:58 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D9B543D2F for ; Fri, 21 May 2004 10:00:58 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i4LH0lOX074907 for ; Fri, 21 May 2004 10:00:47 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i4LH0lPg074906; Fri, 21 May 2004 10:00:47 -0700 (PDT) (envelope-from gnats) Date: Fri, 21 May 2004 10:00:47 -0700 (PDT) Message-Id: <200405211700.i4LH0lPg074906@freefall.freebsd.org> To: freebsd-doc@FreeBSD.org From: Bill Moran Subject: Re: docs/66963: [patch] handbook - a note on /etc/crontab X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bill Moran List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2004 17:00:58 -0000 The following reply was made to PR docs/66963; it has been noted by GNATS. From: Bill Moran To: freebsd-gnats-submit@FreeBSD.org, platanthera@web.de Cc: Subject: Re: docs/66963: [patch] handbook - a note on /etc/crontab Date: Fri, 21 May 2004 12:55:25 -0400 Here is an updated patch that adds some additional explanation/notes: Rendered version availabe here: http://www.potentialtech.com/wmoran/configtuning-cron.html -- Bill Moran Potential Technologies http://www.potentialtech.com --- chapter-old.sgml Tue May 4 16:51:58 2004 +++ chapter.sgml Fri May 21 11:33:11 2004 @@ -441,8 +441,30 @@ crontab files store information about specific functions which cron is supposed to perform at certain times. + + The cron utility uses two different + types of configuration files, the system crontab and user crontabs. The + only difference between these two formats is the sixth field. In the + system crontab, the sixth field is the name of a user for the command + to run as. This gives the system crontab the ability to run commands + as any user. In a user crontab, the sixth field is the command to run, + and all commands run as the user who created the crontab; this is an + important security feature. + + + The reason user crontabs exist is to allow individual users to + schedule tasks without the need for root priviledges. Commands in + a user's crontab run with the permissions of the user who owns the + crontab. + The root user can have a user crontab just like + any other user. This is a different crontab from + /etc/crontab (the system crontab). Because of the + system crontab, there's generally no reason to create a user crontab + for root. + - Let us take a look at the /etc/crontab file: + Let us take a look at the /etc/crontab file + (the system crontab): # /etc/crontab - root's crontab for &os; @@ -526,21 +548,35 @@ /etc/crontab file. This field should be omitted for individual user crontab files. - + Installing a Crontab - - To install your freshly written - crontab, just use the + + + You must not use the procedure described here to + edit/install the system crontab. Simply use your favorite + editor, the cron utility will notice that the file + has changed and immediately begin using the updated version. + See + + this FAQ entry for more information. + + + To install a freshly written user + crontab, first use your favorite editor to create + a file in the proper format, then use the crontab utility. The most common usage is: - &prompt.root; crontab crontab + &prompt.user; crontab crontab-file + + In this example, crontab-file is the filename + of a crontab that was previously created. There is also an option to list installed crontab files, just pass the - to crontab and look + option to crontab and look over the output. For users who wish to begin their own crontab file from scratch, @@ -548,6 +584,11 @@ option is available. This will invoke the selected editor with an empty file. When the file is saved, it will be automatically installed by the crontab command. + + + If you later want to remove your user crontab + completely, use crontab with the + option.