From owner-freebsd-questions Mon Nov 25 2: 0:20 2002 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 329AB37B401 for ; Mon, 25 Nov 2002 02:00:19 -0800 (PST) Received: from bellavista.cz (mail.bellavista.cz [62.168.44.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 696E943E88 for ; Mon, 25 Nov 2002 02:00:17 -0800 (PST) (envelope-from neuhauser@bellavista.cz) Received: from freepuppy.bellavista.cz ([10.1.0.1]) by bellavista.cz (8.9.3/8.9.8) with ESMTP id LAA10233; Mon, 25 Nov 2002 11:00:10 +0100 Received: by freepuppy.bellavista.cz (Postfix, from userid 1001) id 66B0E2FDAB2; Mon, 25 Nov 2002 10:59:38 +0100 (CET) Date: Mon, 25 Nov 2002 10:59:38 +0100 From: Roman Neuhauser To: Jeff Penn Cc: freebsd-questions@freebsd.org Subject: Re: Changing to/from user within script Message-ID: <20021125095938.GU77198@freepuppy.bellavista.cz> Mail-Followup-To: Jeff Penn , freebsd-questions@freebsd.org References: <20021121221155.GA3926@jrpenn.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021121221155.GA3926@jrpenn.demon.co.uk> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG # jeff@jrpenn.demon.co.uk / 2002-11-21 22:11:55 +0000: > I want to run a cron job as a user on my system. Once the job has > completed I need root privileges to power the system down. I don't > mind if the script has to run as a root cron job, but running the > processing as a user will prevent against filling a partition. 1) joe's crontab: # do the grunt work touch /var/run/shutdown root's crontab: [ -f /var/run/shutdown ] && \ rm -f /var/run/shutdown && \ /sbin/shutdown -h now 2) joe's crontab: # do the grunt work /usr/local/bin/sudo /sbin/shutdown -h now -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message