Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jun 2005 13:38:58 -0700 (PDT)
From:      Philip Hallstrom <freebsd@philip.pjkh.com>
To:        Gerard Seibert <gerard-seibert@suscom.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Running Programs from CRON as root
Message-ID:  <20050629133652.I52656@wolf.pjkh.com>
In-Reply-To: <20050629161011.E77E.GERARD-SEIBERT@suscom.net>
References:  <20050629161011.E77E.GERARD-SEIBERT@suscom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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
#
##################################################



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050629133652.I52656>