From owner-freebsd-questions@FreeBSD.ORG Wed Jun 29 20:39:05 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E24CA16A41C for ; Wed, 29 Jun 2005 20:39:05 +0000 (GMT) (envelope-from freebsd@philip.pjkh.com) Received: from zhonka1.zhonka.net (zhonka1.zhonka.net [66.228.195.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDE3343D53 for ; Wed, 29 Jun 2005 20:39:05 +0000 (GMT) (envelope-from freebsd@philip.pjkh.com) Received: from wolf.pjkh.com ([66.228.196.74]) by zhonka1.zhonka.net (Post.Office MTA v3.5.3 release 223 ID# 0-58414U4500L450S0V35) with ESMTP id net; Wed, 29 Jun 2005 13:39:04 -0700 Received: from localhost (localhost [127.0.0.1]) by wolf.pjkh.com (Postfix) with ESMTP id 7CCE258C7; Wed, 29 Jun 2005 13:38:58 -0700 (PDT) Received: from wolf.pjkh.com ([127.0.0.1]) by localhost (wolf.pjkh.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 52285-03; Wed, 29 Jun 2005 13:38:58 -0700 (PDT) Received: by wolf.pjkh.com (Postfix, from userid 1000) id 445C858C5; Wed, 29 Jun 2005 13:38:58 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by wolf.pjkh.com (Postfix) with ESMTP id 3D75C58BA; Wed, 29 Jun 2005 13:38:58 -0700 (PDT) Date: Wed, 29 Jun 2005 13:38:58 -0700 (PDT) From: Philip Hallstrom To: Gerard Seibert In-Reply-To: <20050629161011.E77E.GERARD-SEIBERT@suscom.net> Message-ID: <20050629133652.I52656@wolf.pjkh.com> References: <20050629161011.E77E.GERARD-SEIBERT@suscom.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at pjkh.com Cc: freebsd-questions@freebsd.org Subject: Re: Running Programs from CRON as root X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2005 20:39:06 -0000 On Wed, 29 Jun 2005, Gerard Seibert wrote: > I am not sure how to go about this. If I do not want to touch the system > CRON, is it possible to create a personal CRON that could run two > programs, both at the super user level" > > Example: > > I want to update the ports tree and then run portmanager to install the > updates. These obviously have to be run as root. Is there a way I can > force this to happen without actually leaving the system logged in as > root? Sure... as root, type "crontab -e" and put in your entries according to the crontab format. This will store the entries in root's personal cron file. Not /etc/crontab... Save the file. Logout. I find it helpful to paste this at the top of my crontab files to help me remember the format... ################################################## # # field allowed values # ----- -------------- # minute 0-59 # hour 0-23 # day of month 1-31 # month 1-12 (or names, see below) # day of week 0-7 (0 or 7 is Sun, or use names) # command /path/to/cmd arg1 arg2 # ##################################################