From owner-freebsd-questions@FreeBSD.ORG Wed Apr 5 09:06:55 2006 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 C9CE516A422 for ; Wed, 5 Apr 2006 09:06:55 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F6D143D6D for ; Wed, 5 Apr 2006 09:06:54 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.pc (aris.bedc.ondsl.gr [62.103.39.226]) (authenticated bits=128) by igloo.linux.gr (8.13.6/8.13.6/Debian-1) with ESMTP id k3596eab011323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 5 Apr 2006 12:06:41 +0300 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.4/8.13.4) with ESMTP id k3597Tiu039468; Wed, 5 Apr 2006 12:07:29 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.pc (8.13.4/8.13.4/Submit) id k3597TKp039467; Wed, 5 Apr 2006 12:07:29 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 5 Apr 2006 12:07:29 +0300 From: Giorgos Keramidas To: Marlon Martin Message-ID: <20060405090729.GC29282@gothmog.pc> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.372, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.83, BAYES_00 -2.60, DNS_FROM_RFC_ABUSE 0.20) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org Subject: Re: cron question 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, 05 Apr 2006 09:06:55 -0000 On 2006-04-05 07:03, Marlon Martin wrote: > i created a simple shell script: > > filename: rn > > #!/bin/sh > rndc dumpdb > > what it does, is just dump the hostname and IP addresses in /var/dump > i set the time in 2 minutes but when i checked the logs, it doesnt work any > idea what did i missed here? > > ============================================== > > SHELL=/bin/sh > PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin > HOME=/var/log > # > #minute hour mday month wday who command > # > */5 * * * * root /usr/libexec/atrun > # > # Save some entropy so that /dev/random can re-seed on boot. > */11 * * * * operator /usr/libexec/save-entropy > # > # Rotate log files every hour, if necessary. > 0 * * * * root newsyslog > # > # Perform daily/weekly/monthly maintenance. > 1 3 * * * root periodic daily > 15 4 * * 6 root periodic weekly > 30 5 1 * * root periodic monthly > /2 * * * * root /home/ken/rn You are missing a star '*' character before '/2' near the beginning of the line immediatelly above. Try this instead: */2 * * * * root /home/ken/rn Then make sure /home/ken/rn is executable. I'd also suggest moving your `rn' script in `/root/scripts/rn' and making `root:wheel' its owner. The crontab entries from `/etc/crontab' are executed with root permissions, so giving the user `ken' control over what runs is creating a backdoor for anyone who gets access to that non-root user account. - Giorgos